[nginx] svn commit: r5167 - trunk/src/http/modules

vbart at nginx.com vbart at nginx.com
Wed Apr 3 14:13:36 UTC 2013


Author: vbart
Date: 2013-04-03 14:13:35 +0000 (Wed, 03 Apr 2013)
New Revision: 5167
URL: http://trac.nginx.org/nginx/changeset/5167/nginx

Log:
Limit req: rate should be non-zero.

Specifying zero rate caused division by zero when calculating delays.


Modified:
   trunk/src/http/modules/ngx_http_limit_req_module.c

Modified: trunk/src/http/modules/ngx_http_limit_req_module.c
===================================================================
--- trunk/src/http/modules/ngx_http_limit_req_module.c	2013-04-02 12:34:39 UTC (rev 5166)
+++ trunk/src/http/modules/ngx_http_limit_req_module.c	2013-04-03 14:13:35 UTC (rev 5167)
@@ -795,7 +795,7 @@
             }
 
             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;



More information about the nginx-devel mailing list