changeset 3191:30f841e2536d

fix r3184
author Igor Sysoev <igor@sysoev.ru>
date Tue, 06 Oct 2009 16:08:15 +0000
parents dd2ae3872634
children 4bc73c644329
files src/http/modules/ngx_http_limit_req_module.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
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;