changeset 5166:fc595eeb6c54

Limit req: rate should be non-zero. Specifying zero rate caused division by zero when calculating delays.
author Valentin Bartenev <vbart@nginx.com>
date Wed, 03 Apr 2013 14:13:35 +0000
parents 4bcd35e7a0f0
children 85ee9d858dcb
files src/http/modules/ngx_http_limit_req_module.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -795,7 +795,7 @@ ngx_http_limit_req_zone(ngx_conf_t *cf, 
             }
 
             rate = ngx_atoi(value[i].data + 5, len - 5);
-            if (rate <= NGX_ERROR) {
+            if (rate <= 0) {
                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                    "invalid rate \"%V\"", &value[i]);
                 return NGX_CONF_ERROR;