64-bit time_t compatibility
diff --git a/src/http/modules/ngx_http_log_module.c b/src/http/modules/ngx_http_log_module.c
index fb7b26c..157b15c 100644
--- a/src/http/modules/ngx_http_log_module.c
+++ b/src/http/modules/ngx_http_log_module.c
@@ -400,7 +400,8 @@
 
     tp = ngx_timeofday();
 
-    ms = (tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec);
+    ms = (ngx_msec_int_t)
+             ((tp->sec - r->start_sec) * 1000 + (tp->msec - r->start_msec));
     ms = (ms >= 0) ? ms : 0;
 
     return ngx_sprintf(buf, "%T.%03M", ms / 1000, ms % 1000);
diff --git a/src/http/modules/ngx_http_userid_filter_module.c b/src/http/modules/ngx_http_userid_filter_module.c
index 5587b00..82a9fdf 100644
--- a/src/http/modules/ngx_http_userid_filter_module.c
+++ b/src/http/modules/ngx_http_userid_filter_module.c
@@ -318,7 +318,7 @@
             } else {
                 ctx->uid_set[0] = conf->service;
             }
-            ctx->uid_set[1] = ngx_time();
+            ctx->uid_set[1] = (uint32_t) ngx_time();
             ctx->uid_set[2] = ngx_pid;
             ctx->uid_set[3] = sequencer_v1;
             sequencer_v1 += 0x100;
@@ -345,7 +345,7 @@
                 ctx->uid_set[0] = htonl(conf->service);
             }
 
-            ctx->uid_set[1] = htonl(ngx_time());
+            ctx->uid_set[1] = htonl((uint32_t) ngx_time());
             ctx->uid_set[2] = htonl(ngx_pid);
             ctx->uid_set[3] = htonl(sequencer_v2);
             sequencer_v2 += 0x100;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index c1dc3a6..86f2446 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2341,7 +2341,7 @@
         return;
     }
 
-    timer = r->lingering_time - ngx_time();
+    timer = (ngx_msec_t) (r->lingering_time - ngx_time());
     if (timer <= 0) {
         ngx_http_close_request(r, 0);
         return;
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index a9583c7..a5b6813 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -493,7 +493,7 @@
     }
 
     if (r->lingering_time) {
-        timer = r->lingering_time - ngx_time();
+        timer = (ngx_msec_t) (r->lingering_time - ngx_time());
 
         if (timer <= 0) {
             r->discard_body = 0;
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index c6de92b..0c36925 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2873,7 +2873,8 @@
 
     for ( ;; ) {
         if (state[i].status) {
-            ms = state[i].response_sec * 1000 + state[i].response_msec;
+            ms = (ngx_msec_int_t)
+                     (state[i].response_sec * 1000 + state[i].response_msec);
             ms = (ms >= 0) ? ms : 0;
             p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000);