[nginx] Upstream: fixed non-buffered proxying with eventport.

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


details:   https://hg.nginx.org/nginx/rev/b1302f1dd2f6
branches:  
changeset: 7809:b1302f1dd2f6
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sun Mar 28 17:45:35 2021 +0300
description:
Upstream: fixed non-buffered proxying with eventport.

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.

diffstat:

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

diffs (14 lines):

diff -r eb54227110f0 -r b1302f1dd2f6 src/http/ngx_http_upstream.c
--- a/src/http/ngx_http_upstream.c	Sun Mar 28 17:45:31 2021 +0300
+++ b/src/http/ngx_http_upstream.c	Sun Mar 28 17:45:35 2021 +0300
@@ -3011,9 +3011,7 @@ ngx_http_upstream_send_response(ngx_http
                 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;


More information about the nginx-devel mailing list