comparison src/http/ngx_http_core_module.c @ 2085:505af86ac9cb

show an error message for invalid parameter
author Igor Sysoev <igor@sysoev.ru>
date Thu, 03 Jul 2008 19:19:45 +0000
parents 5657037448d1
children 5e954395a15e
comparison
equal deleted inserted replaced
2084:5baf7e5b2d6e 2085:505af86ac9cb
3497 3497
3498 if (ngx_strncmp(value[i].data, "max=", 4) == 0) { 3498 if (ngx_strncmp(value[i].data, "max=", 4) == 0) {
3499 3499
3500 max = ngx_atoi(value[i].data + 4, value[i].len - 4); 3500 max = ngx_atoi(value[i].data + 4, value[i].len - 4);
3501 if (max == NGX_ERROR) { 3501 if (max == NGX_ERROR) {
3502 return NGX_CONF_ERROR; 3502 goto failed;
3503 } 3503 }
3504 3504
3505 continue; 3505 continue;
3506 } 3506 }
3507 3507
3510 s.len = value[i].len - 9; 3510 s.len = value[i].len - 9;
3511 s.data = value[i].data + 9; 3511 s.data = value[i].data + 9;
3512 3512
3513 inactive = ngx_parse_time(&s, 1); 3513 inactive = ngx_parse_time(&s, 1);
3514 if (inactive < 0) { 3514 if (inactive < 0) {
3515 return NGX_CONF_ERROR; 3515 goto failed;
3516 } 3516 }
3517 3517
3518 continue; 3518 continue;
3519 } 3519 }
3520 3520
3522 3522
3523 lcf->open_file_cache = NULL; 3523 lcf->open_file_cache = NULL;
3524 3524
3525 continue; 3525 continue;
3526 } 3526 }
3527
3528 failed:
3527 3529
3528 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 3530 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
3529 "invalid \"open_file_cache\" parameter \"%V\"", 3531 "invalid \"open_file_cache\" parameter \"%V\"",
3530 &value[i]); 3532 &value[i]);
3531 return NGX_CONF_ERROR; 3533 return NGX_CONF_ERROR;