[nginx] HTTP/3: synced request body reading changes to reduce di...

Maxim Dounin mdounin at mdounin.ru
Sat Mar 30 04:59:47 UTC 2024


details:   http://freenginx.org/hg/nginx/rev/07ca679842de
branches:  
changeset: 9241:07ca679842de
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Sat Mar 30 05:10:24 2024 +0300
description:
HTTP/3: synced request body reading changes to reduce diffs.

diffstat:

 src/http/v3/ngx_http_v3_request.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (29 lines):

diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c
--- a/src/http/v3/ngx_http_v3_request.c
+++ b/src/http/v3/ngx_http_v3_request.c
@@ -1329,6 +1329,7 @@ ngx_http_v3_do_read_client_request_body(
     c = r->connection;
     rb = r->request_body;
     flush = 1;
+    n = NGX_AGAIN;
 
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0,
                    "http3 read client request body");
@@ -1432,7 +1433,7 @@ ngx_http_v3_do_read_client_request_body(
                 break;
             }
 
-            if (rb->buf->last < rb->buf->end) {
+            if (!c->read->ready) {
                 break;
             }
         }
@@ -1452,7 +1453,7 @@ ngx_http_v3_do_read_client_request_body(
             break;
         }
 
-        if (!c->read->ready || rb->rest == 0) {
+        if (n == NGX_AGAIN || !c->read->ready || rb->rest == 0) {
 
             clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
             ngx_add_timer(c->read, clcf->client_body_timeout);



More information about the nginx-devel mailing list