aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-07-09 14:02:09 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-07-09 14:02:09 +0000
commita4eb3f0e02541a3b64600e9f59339d4929ff6e84 (patch)
tree8461d762bd13798286cb271f6bca2ba5ab410b8a /src
parent2e9542b9106144e534bc79b8b1589908f73fa4b5 (diff)
downloadnginx-a4eb3f0e02541a3b64600e9f59339d4929ff6e84.tar.gz
nginx-a4eb3f0e02541a3b64600e9f59339d4929ff6e84.zip
fix client write event handling in ngx_http_limit_req_module
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_limit_req_module.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c
index 2a07c74e5..7f1685ac5 100644
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -263,9 +263,24 @@ done:
static void
ngx_http_limit_req_delay(ngx_http_request_t *r)
{
+ ngx_event_t *wev;
+
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"limit_req delay");
+ wev = r->connection->write;
+
+ if (!wev->timedout) {
+
+ if (ngx_handle_write_event(wev, 0) != NGX_OK) {
+ ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
+ }
+
+ return;
+ }
+
+ wev->timedout = 0;
+
if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;