summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2021-03-30 23:34:51 +0300
committerSergey Kandaurov <pluknet@nginx.com>2021-03-30 23:34:51 +0300
commitdd98809befadeda443a0e25da70c3020e613481e (patch)
tree9a21777e29904ad66ddb5b852d55036aff15476b /src/http/ngx_http_core_module.c
parent7d1cf8ffb442727bc8e54630dd565c8139cead67 (diff)
parent7b053dd1b20237622f89148e6c01a43927a4572a (diff)
downloadnginx-dd98809befadeda443a0e25da70c3020e613481e.tar.gz
nginx-dd98809befadeda443a0e25da70c3020e613481e.tar.bz2
Merged with the default branch.
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 25339130e..ffbed5151 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1190,8 +1190,13 @@ ngx_http_core_auth_delay(ngx_http_request_t *r)
ngx_log_error(NGX_LOG_INFO, r->connection->log, 0,
"delaying unauthorized request");
- 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;