mirror of
https://github.com/nginx/nginx.git
synced 2025-08-06 14:56:15 +08:00
fix client write event handling in ngx_http_limit_req_module
This commit is contained in:
parent
2e9542b910
commit
a4eb3f0e02
@ -263,9 +263,24 @@ done:
|
|||||||
static void
|
static void
|
||||||
ngx_http_limit_req_delay(ngx_http_request_t *r)
|
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,
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||||
"limit_req delay");
|
"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) {
|
if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
|
||||||
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user