comparison ngx_http_upstream_keepalive_module.c @ 4:e18e4613b841

Keepalive: unbreak cache size parsing and protect from zero.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 23 Oct 2008 19:11:15 +0400
parents 42e64900483b
children e7d1b49e0611
comparison
equal deleted inserted replaced
3:42e64900483b 4:e18e4613b841
52 52
53 53
54 static ngx_command_t ngx_http_upstream_keepalive_commands[] = { 54 static ngx_command_t ngx_http_upstream_keepalive_commands[] = {
55 55
56 { ngx_string("keepalive"), 56 { ngx_string("keepalive"),
57 NGX_HTTP_UPS_CONF|NGX_CONF_NOARGS, 57 NGX_HTTP_UPS_CONF|NGX_CONF_NOARGS|NGX_CONF_TAKE1,
58 ngx_http_upstream_keepalive, 58 ngx_http_upstream_keepalive,
59 0, 59 0,
60 0, 60 0,
61 NULL }, 61 NULL },
62 62
368 for (i = 1; i < cf->args->nelts; i++) { 368 for (i = 1; i < cf->args->nelts; i++) {
369 369
370 if (ngx_strncmp(value[i].data, "cached=", 7) == 0) { 370 if (ngx_strncmp(value[i].data, "cached=", 7) == 0) {
371 n = ngx_atoi(&value[i].data[7], value[i].len - 7); 371 n = ngx_atoi(&value[i].data[7], value[i].len - 7);
372 372
373 if (n == NGX_ERROR) { 373 if (n == NGX_ERROR || n == 0) {
374 goto invalid; 374 goto invalid;
375 } 375 }
376 376
377 kcf->max_cached = n; 377 kcf->max_cached = n;
378 378