summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2020-08-20 12:33:00 +0300
committerRoman Arutyunyan <arut@nginx.com>2020-08-20 12:33:00 +0300
commit5a4aaa6aed4d4b97d09548035298a90bf984a997 (patch)
tree3d18efc61d8f7d0bf9b4513004ab4f7d0712aac2 /src/http/ngx_http_upstream.c
parent7ce1a68aadec80a2c4a3b27f3fd3d7342043299b (diff)
downloadnginx-5a4aaa6aed4d4b97d09548035298a90bf984a997.tar.gz
nginx-5a4aaa6aed4d4b97d09548035298a90bf984a997.tar.bz2
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.
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 47f98ccb2..88e7b6fad 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -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) {