comparison src/http/ngx_http_upstream.c @ 3515:76d252724db5

use ngx_min() and ngx_max()
author Igor Sysoev <igor@sysoev.ru>
date Fri, 14 May 2010 09:55:33 +0000
parents 58865853f29b
children dd1570b6f237
comparison
equal deleted inserted replaced
3514:58865853f29b 3515:76d252724db5
3708 3708
3709 for ( ;; ) { 3709 for ( ;; ) {
3710 if (state[i].status) { 3710 if (state[i].status) {
3711 ms = (ngx_msec_int_t) 3711 ms = (ngx_msec_int_t)
3712 (state[i].response_sec * 1000 + state[i].response_msec); 3712 (state[i].response_sec * 1000 + state[i].response_msec);
3713 ms = (ms >= 0) ? ms : 0; 3713 ms = ngx_max(ms, 0);
3714 p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000); 3714 p = ngx_sprintf(p, "%d.%03d", ms / 1000, ms % 1000);
3715 3715
3716 } else { 3716 } else {
3717 *p++ = '-'; 3717 *p++ = '-';
3718 } 3718 }