]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed broken connection check with eventport.
authorMaxim Dounin <mdounin@mdounin.ru>
Sun, 28 Mar 2021 14:45:37 +0000 (17:45 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Sun, 28 Mar 2021 14:45:37 +0000 (17:45 +0300)
For connection close to be reported with eventport on Solaris,
ngx_handle_read_event() needs to be called.

src/http/ngx_http_upstream.c

index a01784aaac1935e0359a0885eb1f45e537ad272c..bd1627c091fa0c8c8edbfdf67465e2815151b881 100644 (file)
@@ -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;
     }