From 4efbd6ab364992c32469d51e91da54671f83e5ff Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Tue, 6 Oct 2009 16:08:15 +0000 Subject: fix r3184 --- src/http/modules/ngx_http_limit_req_module.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c index c9ff20c87..f9b64f1f8 100644 --- 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_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; -- cgit