changeset 3525:eb156d98a9fa

fix delay in limit_req
author Igor Sysoev <igor@sysoev.ru>
date Mon, 24 May 2010 07:43:39 +0000
parents ca24774c16e3
children 62a4fd1e6e2c
files src/http/modules/ngx_http_limit_req_module.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/modules/ngx_http_limit_req_module.c	Sun May 23 19:36:12 2010 +0000
+++ b/src/http/modules/ngx_http_limit_req_module.c	Mon May 24 07:43:39 2010 +0000
@@ -229,7 +229,8 @@
 
         r->read_event_handler = ngx_http_test_reading;
         r->write_event_handler = ngx_http_limit_req_delay;
-        ngx_add_timer(r->connection->write, (ngx_msec_t) excess);
+        ngx_add_timer(r->connection->write,
+                      (ngx_msec_t) excess * 1000 / ctx->rate);
 
         return NGX_AGAIN;
     }