64-bit time_t compatibility
diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c index 551e102..949e0c6 100644 --- a/src/core/ngx_times.c +++ b/src/core/ngx_times.c
@@ -205,16 +205,16 @@ { ngx_int_t sec, min, hour, mday, mon, year, wday, yday, days; - days = t / 86400; + days = (ngx_int_t) (t / 86400); /* Jaunary 1, 1970 was Thursday */ wday = (4 + days) % 7; t %= 86400; - hour = t / 3600; + hour = (ngx_int_t) (t / 3600); t %= 3600; - min = t / 60; - sec = t % 60; + min = (ngx_int_t) (t / 60); + sec = (ngx_int_t) (t % 60); /* the algorithm based on Gauss's formula */
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);
diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c index 0bde162..17e7861 100644 --- a/src/mail/ngx_mail_auth_http_module.c +++ b/src/mail/ngx_mail_auth_http_module.c
@@ -718,7 +718,7 @@ return; } - ngx_add_timer(s->connection->read, timer * 1000); + ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000)); s->connection->read->handler = ngx_mail_auth_sleep_handler; @@ -735,7 +735,7 @@ return; } - ngx_add_timer(s->connection->read, timer * 1000); + ngx_add_timer(s->connection->read, (ngx_msec_t) (timer * 1000)); s->connection->read->handler = ngx_mail_auth_sleep_handler;