[PATCH] Limit Req: make burst value could be explicitly set to 0

Gu Feng flygoast at 126.com
Tue Sep 22 11:56:39 UTC 2015


# HG changeset patch
# User Gu Feng <flygoast at 126.com>
# Date 1442922745 -28800
#      Tue Sep 22 19:52:25 2015 +0800
# Node ID 055d05b5dc54a03b764034a92f9bfb3f5a550993
# Parent  0256738454dc7527f9b0bbaf90b3053a70fd99ed
Limit Req: make burst value could be explicitly set to 0.

The default value of burst is 0 when no 'busrt' in directive limit_req. Maybe
it's more reasonable that it could be explicitly set to 0.

diff -r 0256738454dc -r 055d05b5dc54 src/http/modules/ngx_http_limit_req_module.c
--- a/src/http/modules/ngx_http_limit_req_module.c	Tue Sep 15 17:49:15 2015 +0300
+++ b/src/http/modules/ngx_http_limit_req_module.c	Tue Sep 22 19:52:25 2015 +0800
@@ -893,7 +893,7 @@ ngx_http_limit_req(ngx_conf_t *cf, ngx_c
         if (ngx_strncmp(value[i].data, "burst=", 6) == 0) {
 
             burst = ngx_atoi(value[i].data + 6, value[i].len - 6);
-            if (burst <= 0) {
+            if (burst < 0) {
                 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
                                    "invalid burst rate \"%V\"", &value[i]);
                 return NGX_CONF_ERROR;



More information about the nginx-devel mailing list