]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed non-buffered proxying with eventport.
authorMaxim Dounin <mdounin@mdounin.ru>
Sun, 28 Mar 2021 14:45:35 +0000 (17:45 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Sun, 28 Mar 2021 14:45:35 +0000 (17:45 +0300)
For new data to be reported with eventport on Solaris,
ngx_handle_read_event() needs to be called after reading response
headers.  To do so, ngx_http_upstream_process_non_buffered_upstream()
now called unconditionally if there are no prepread data.  This
won't cause any read() syscalls as long as upstream connection
is not ready for reading (c->read->ready is not set), but will result
in proper handling of all events.

src/http/ngx_http_upstream.c

index 9cbb5a3b0c9735fa25abb0fac010fc93b2c25268..a01784aaac1935e0359a0885eb1f45e537ad272c 100644 (file)
@@ -3011,9 +3011,7 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
                 return;
             }
 
-            if (u->peer.connection->read->ready || u->length == 0) {
-                ngx_http_upstream_process_non_buffered_upstream(r, u);
-            }
+            ngx_http_upstream_process_non_buffered_upstream(r, u);
         }
 
         return;