changeset 8521:a748095bf94e quic

HTTP/3: special handling of client errors in the upstream module. 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.
author Roman Arutyunyan <arut@nginx.com>
date Thu, 20 Aug 2020 12:33:00 +0300
parents 357b8afe915e
children fc89d02bdca2
files src/http/ngx_http_upstream.c
diffstat 1 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1345,6 +1345,19 @@ ngx_http_upstream_check_broken_connectio
     }
 #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) {