]> git.kaiwu.me - nginx.git/commitdiff
Upstream: fixed processing multiple 103 (early hints) responses.
authorSergey Kandaurov <pluknet@nginx.com>
Thu, 2 Apr 2026 13:41:56 +0000 (17:41 +0400)
committerSergey Kandaurov <s.kandaurov@f5.com>
Thu, 2 Apr 2026 16:54:32 +0000 (20:54 +0400)
The second 103 response in a row was treated as the final response header.

src/http/ngx_http_upstream.c

index f177f0a2854473889a8116bcaec191468888d574..c84defaa953dbca6fc6cf1f9bd1f8dd33469d971 100644 (file)
@@ -2550,6 +2550,8 @@ ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u)
 
         u->response_received = 1;
 
+again:
+
         rc = u->process_header(r);
 
         if (rc == NGX_AGAIN) {
@@ -2570,11 +2572,7 @@ ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u)
             rc = ngx_http_upstream_process_early_hints(r, u);
 
             if (rc == NGX_OK) {
-                rc = u->process_header(r);
-
-                if (rc == NGX_AGAIN) {
-                    continue;
-                }
+                goto again;
             }
         }