]> git.kaiwu.me - nginx.git/commitdiff
fix r3184
authorIgor Sysoev <igor@sysoev.ru>
Tue, 6 Oct 2009 16:08:15 +0000 (16:08 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Tue, 6 Oct 2009 16:08:15 +0000 (16:08 +0000)
src/http/modules/ngx_http_limit_req_module.c

index c9ff20c87f7c8c4197d038d88d7f73ebe7dd0b55..f9b64f1f86065e6f0dd54a8657bcc845f34d9929 100644 (file)
@@ -398,15 +398,15 @@ ngx_http_limit_req_lookup(ngx_http_limit_req_conf_t *lrcf, ngx_uint_t hash,
 
                 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;