[nginx] Upstream: fixed broken connection check with eventport.

Maxim Dounin mdounin at mdounin.ru
Sun Mar 28 14:47:16 UTC 2021


details:   https://hg.nginx.org/nginx/rev/1bf8ab7063de
branches:  
changeset: 7810:1bf8ab7063de
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sun Mar 28 17:45:37 2021 +0300
description:
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.

diffstat:

 src/http/ngx_http_upstream.c |  6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diffs (16 lines):

diff -r b1302f1dd2f6 -r 1bf8ab7063de src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Sun Mar 28 17:45:35 2021 +0300
+++ b/src/http/ngx_http_upstream.c	Sun Mar 28 17:45:37 2021 +0300
@@ -607,6 +607,12 @@ ngx_http_upstream_init_request(ngx_http_
     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;
     }


More information about the nginx-devel mailing list