diff src/http/modules/ngx_http_limit_req_module.c @ 534:a52c99698e7f NGINX_0_8_19

nginx 0.8.19 *) Change: now SSLv2 protocol is disabled by default. *) Change: now default SSL ciphers are "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM". *) Bugfix: a "limit_req" directive did not work; the bug had appeared in 0.8.18.
author Igor Sysoev <http://sysoev.ru>
date Tue, 06 Oct 2009 00:00:00 +0400
parents f7ec98e3caeb
children ff463db0be31
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
@@ -398,15 +398,15 @@ ngx_http_limit_req_lookup(ngx_http_limit
 
                 excess = lr->excess - ctx->rate * ngx_abs(ms) / 1000 + 1000;
 
+                if (excess < 0) {
+                    excess = 0;
+                }
+
                 if ((ngx_uint_t) excess > lrcf->burst) {
                     *lrp = lr;
                     return NGX_BUSY;
                 }
 
-                if (excess < 0) {
-                    excess = 0;
-                }
-
                 lr->excess = excess;
                 lr->last = now;