changeset 888:bb6e1bbcdd67

fix msec overflow
author Igor Sysoev <igor@sysoev.ru>
date Tue, 05 Dec 2006 20:30:05 +0000
parents d233308a70a3
children a9a7e4b1a72b
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -502,7 +502,7 @@ ngx_http_upstream_connect(ngx_http_reque
 
     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_reque
     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_h
 
     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;
     }