# HG changeset patch # User Maxim Dounin # Date 1224774675 -14400 # Node ID e18e4613b841b2b27c7042b7ce5772d47466fa95 # Parent 42e64900483bb252e1a6d97588be11cf6215a819 Keepalive: unbreak cache size parsing and protect from zero. diff --git a/ngx_http_upstream_keepalive_module.c b/ngx_http_upstream_keepalive_module.c --- a/ngx_http_upstream_keepalive_module.c +++ b/ngx_http_upstream_keepalive_module.c @@ -54,7 +54,7 @@ static char *ngx_http_upstream_keepalive static ngx_command_t ngx_http_upstream_keepalive_commands[] = { { ngx_string("keepalive"), - NGX_HTTP_UPS_CONF|NGX_CONF_NOARGS, + NGX_HTTP_UPS_CONF|NGX_CONF_NOARGS|NGX_CONF_TAKE1, ngx_http_upstream_keepalive, 0, 0, @@ -370,7 +370,7 @@ ngx_http_upstream_keepalive(ngx_conf_t * if (ngx_strncmp(value[i].data, "cached=", 7) == 0) { n = ngx_atoi(&value[i].data[7], value[i].len - 7); - if (n == NGX_ERROR) { + if (n == NGX_ERROR || n == 0) { goto invalid; }