Klaus Demo nginx / 8b6844c
fix msec overflow Igor Sysoev 14 years ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
501501
502502 if (u->state && u->state->response_time) {
503503 tp = ngx_timeofday();
504 ms = tp->sec * 1000 + tp->msec - u->state->response_time;
504 ms = (ngx_msec_t) tp->sec * 1000 + tp->msec - u->state->response_time;
505505 u->state->response_time = (ms >= 0) ? ms : 0;
506506 }
507507
515515 ngx_memzero(u->state, sizeof(ngx_http_upstream_state_t));
516516
517517 tp = ngx_timeofday();
518 u->state->response_time = tp->sec * 1000 + tp->msec;
518 u->state->response_time = (ngx_msec_t) tp->sec * 1000 + tp->msec;
519519
520520 rc = ngx_event_connect_peer(&u->peer);
521521
20522052
20532053 if (u->state->response_time) {
20542054 tp = ngx_timeofday();
2055 ms = tp->sec * 1000 + tp->msec - u->state->response_time;
2055 ms = (ngx_msec_t) tp->sec * 1000 + tp->msec - u->state->response_time;
20562056 u->state->response_time = (ms >= 0) ? ms : 0;
20572057 }
20582058