comparison src/mail/ngx_mail_core_module.c @ 4474:41f640a693de

Time parsing cleanup. Nuke NGX_PARSE_LARGE_TIME, it's not used since 0.6.30. The only error ngx_parse_time() can currently return is NGX_ERROR, check it explicitly and make sure to cast it to appropriate type (either time_t or ngx_msec_t) to avoid signedness warnings on platforms with unsigned time_t (notably QNX).
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 13 Feb 2012 15:41:11 +0000
parents d620f497c50f
children 14411ee4d89f
comparison
equal deleted inserted replaced
4473:3b877a45d343 4474:41f640a693de
477 477
478 if (p > s.data) { 478 if (p > s.data) {
479 s.len = p - s.data; 479 s.len = p - s.data;
480 480
481 ls->tcp_keepidle = ngx_parse_time(&s, 1); 481 ls->tcp_keepidle = ngx_parse_time(&s, 1);
482 if (ls->tcp_keepidle == NGX_ERROR) { 482 if (ls->tcp_keepidle == (time_t) NGX_ERROR) {
483 goto invalid_so_keepalive; 483 goto invalid_so_keepalive;
484 } 484 }
485 } 485 }
486 486
487 s.data = (p < end) ? (p + 1) : end; 487 s.data = (p < end) ? (p + 1) : end;
493 493
494 if (p > s.data) { 494 if (p > s.data) {
495 s.len = p - s.data; 495 s.len = p - s.data;
496 496
497 ls->tcp_keepintvl = ngx_parse_time(&s, 1); 497 ls->tcp_keepintvl = ngx_parse_time(&s, 1);
498 if (ls->tcp_keepintvl == NGX_ERROR) { 498 if (ls->tcp_keepintvl == (time_t) NGX_ERROR) {
499 goto invalid_so_keepalive; 499 goto invalid_so_keepalive;
500 } 500 }
501 } 501 }
502 502
503 s.data = (p < end) ? (p + 1) : end; 503 s.data = (p < end) ? (p + 1) : end;