comparison src/http/modules/ngx_http_limit_req_module.c @ 3525:eb156d98a9fa

fix delay in limit_req
author Igor Sysoev <igor@sysoev.ru>
date Mon, 24 May 2010 07:43:39 +0000
parents 30f841e2536d
children 57aecfdcac3d
comparison
equal deleted inserted replaced
3524:ca24774c16e3 3525:eb156d98a9fa
227 return NGX_HTTP_INTERNAL_SERVER_ERROR; 227 return NGX_HTTP_INTERNAL_SERVER_ERROR;
228 } 228 }
229 229
230 r->read_event_handler = ngx_http_test_reading; 230 r->read_event_handler = ngx_http_test_reading;
231 r->write_event_handler = ngx_http_limit_req_delay; 231 r->write_event_handler = ngx_http_limit_req_delay;
232 ngx_add_timer(r->connection->write, (ngx_msec_t) excess); 232 ngx_add_timer(r->connection->write,
233 (ngx_msec_t) excess * 1000 / ctx->rate);
233 234
234 return NGX_AGAIN; 235 return NGX_AGAIN;
235 } 236 }
236 237
237 if (rc == NGX_OK) { 238 if (rc == NGX_OK) {