diff options
author | Igor Sysoev <igor@sysoev.ru> | 2006-12-05 20:30:05 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2006-12-05 20:30:05 +0000 |
commit | 8b6844c747ce533fba9ab26f3a6eff96e9b318c4 (patch) | |
tree | fd589a7fa13d596bae52bfaf0edde0f83414893d | |
parent | 67effaff99d59f43db2685609629b0dd86c59744 (diff) | |
download | nginx-8b6844c747ce533fba9ab26f3a6eff96e9b318c4.tar.gz nginx-8b6844c747ce533fba9ab26f3a6eff96e9b318c4.zip |
fix msec overflow
-rw-r--r-- | src/http/ngx_http_upstream.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index da1c9adeb..03b590f5b 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -502,7 +502,7 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u) if (u->state && u->state->response_time) { tp = ngx_timeofday(); - ms = tp->sec * 1000 + tp->msec - u->state->response_time; + ms = (ngx_msec_t) tp->sec * 1000 + tp->msec - u->state->response_time; u->state->response_time = (ms >= 0) ? ms : 0; } @@ -516,7 +516,7 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u) ngx_memzero(u->state, sizeof(ngx_http_upstream_state_t)); tp = ngx_timeofday(); - u->state->response_time = tp->sec * 1000 + tp->msec; + u->state->response_time = (ngx_msec_t) tp->sec * 1000 + tp->msec; rc = ngx_event_connect_peer(&u->peer); @@ -2053,7 +2053,7 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r, if (u->state->response_time) { tp = ngx_timeofday(); - ms = tp->sec * 1000 + tp->msec - u->state->response_time; + ms = (ngx_msec_t) tp->sec * 1000 + tp->msec - u->state->response_time; u->state->response_time = (ms >= 0) ? ms : 0; } |