diff src/http/modules/ngx_http_limit_req_module.c @ 3191:30f841e2536d

fix r3184
author Igor Sysoev <igor@sysoev.ru>
date Tue, 06 Oct 2009 16:08:15 +0000
parents 30570a5b9bb0
children eb156d98a9fa
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;