]> git.kaiwu.me - nginx.git/commitdiff
HTTP/3: special handling of client errors in the upstream module.
authorRoman Arutyunyan <arut@nginx.com>
Thu, 20 Aug 2020 09:33:00 +0000 (12:33 +0300)
committerRoman Arutyunyan <arut@nginx.com>
Thu, 20 Aug 2020 09:33:00 +0000 (12:33 +0300)
The function ngx_http_upstream_check_broken_connection() terminates the HTTP/1
request if client sends eof.  For QUIC (including HTTP/3) the c->write->error
flag is now checked instead.  This flag is set when the entire QUIC connection
is closed or STOP_SENDING was received from client.

src/http/ngx_http_upstream.c

index 47f98ccb290f8587194b8ed566faafc9deaeb9da..88e7b6fad3500394540973b6f6d81bcc565b601f 100644 (file)
@@ -1345,6 +1345,19 @@ ngx_http_upstream_check_broken_connection(ngx_http_request_t *r,
     }
 #endif
 
+#if (NGX_HTTP_QUIC)
+
+    if (c->qs) {
+        if (c->write->error) {
+            ngx_http_upstream_finalize_request(r, u,
+                                               NGX_HTTP_CLIENT_CLOSED_REQUEST);
+        }
+
+        return;
+    }
+
+#endif
+
 #if (NGX_HAVE_KQUEUE)
 
     if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) {