[PATCH 2 of 5] HTTP/3: fixed request length calculation

Roman Arutyunyan arut at nginx.com
Thu Oct 7 11:36:15 UTC 2021


# HG changeset patch
# User Roman Arutyunyan <arut at nginx.com>
# Date 1633521076 -10800
#      Wed Oct 06 14:51:16 2021 +0300
# Branch quic
# Node ID 1b87f4e196cce2b7aae33a63ca6dfc857b99f2b7
# Parent  d53039c3224e8227979c113f621e532aef7c0f9b
HTTP/3: fixed request length calculation.

Previously, when request was blocked, r->request_length was not updated.

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
@@ -297,6 +297,8 @@ ngx_http_v3_process_request(ngx_event_t 
             break;
         }
 
+        r->request_length += b->pos - p;
+
         if (rc == NGX_BUSY) {
             if (rev->error) {
                 ngx_http_close_request(r, NGX_HTTP_CLOSE);
@@ -310,8 +312,6 @@ ngx_http_v3_process_request(ngx_event_t 
             break;
         }
 
-        r->request_length += b->pos - p;
-
         if (rc == NGX_AGAIN) {
             continue;
         }


More information about the nginx-devel mailing list