diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2021-03-28 17:45:37 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2021-03-28 17:45:37 +0300 |
commit | 8885c45e1ead18c1fc9325e372069ec9c55e5938 (patch) | |
tree | 76e189579ec2d115c63d04a2b68f58354e5df011 | |
parent | 9104757a7d9adfced7c77396167e3e68bd11867c (diff) |
Upstream: fixed broken connection check with eventport.
For connection close to be reported with eventport on Solaris,
ngx_handle_read_event() needs to be called.
-rw-r--r-- | src/http/ngx_http_upstream.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index a01784aaa..bd1627c09 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -607,6 +607,12 @@ ngx_http_upstream_init_request(ngx_http_request_t *r) u->store = u->conf->store; if (!u->store && !r->post_action && !u->conf->ignore_client_abort) { + + if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) { + ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR); + return; + } + r->read_event_handler = ngx_http_upstream_rd_check_broken_connection; r->write_event_handler = ngx_http_upstream_wr_check_broken_connection; } |