aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_limit_req_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_limit_req_module.c')
-rw-r--r--src/http/modules/ngx_http_limit_req_module.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/http/modules/ngx_http_limit_req_module.c b/src/http/modules/ngx_http_limit_req_module.c
index dad5edb93..2b062a305 100644
--- a/src/http/modules/ngx_http_limit_req_module.c
+++ b/src/http/modules/ngx_http_limit_req_module.c
@@ -310,8 +310,13 @@ ngx_http_limit_req_handler(ngx_http_request_t *r)
r->main->limit_req_status = NGX_HTTP_LIMIT_REQ_DELAYED;
- if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ if (r->connection->read->ready) {
+ ngx_post_event(r->connection->read, &ngx_posted_events);
+
+ } else {
+ if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
}
r->read_event_handler = ngx_http_test_reading;