Mercurial > hg > nginx
comparison src/http/modules/ngx_http_limit_req_module.c @ 2972:c5ad288f851d
fix client write event handling in ngx_http_limit_req_module
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 09 Jul 2009 14:02:09 +0000 |
parents | c7d57b539248 |
children | 70c8b2d28d1d |
comparison
equal
deleted
inserted
replaced
2971:87ddbe960172 | 2972:c5ad288f851d |
---|---|
261 | 261 |
262 | 262 |
263 static void | 263 static void |
264 ngx_http_limit_req_delay(ngx_http_request_t *r) | 264 ngx_http_limit_req_delay(ngx_http_request_t *r) |
265 { | 265 { |
266 ngx_event_t *wev; | |
267 | |
266 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 268 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
267 "limit_req delay"); | 269 "limit_req delay"); |
270 | |
271 wev = r->connection->write; | |
272 | |
273 if (!wev->timedout) { | |
274 | |
275 if (ngx_handle_write_event(wev, 0) != NGX_OK) { | |
276 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | |
277 } | |
278 | |
279 return; | |
280 } | |
281 | |
282 wev->timedout = 0; | |
268 | 283 |
269 if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) { | 284 if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) { |
270 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); | 285 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); |
271 return; | 286 return; |
272 } | 287 } |