diff src/stream/ngx_stream_proxy_module.c @ 8890:b4c7853b0488 quic

QUIC: added shutdown support in stream proxy.
author Vladimir Homutov <vl@nginx.com>
date Thu, 23 Sep 2021 16:25:49 +0300
parents bfad703459b4
children 8d0753760546
line wrap: on
line diff
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -1767,6 +1767,21 @@ ngx_stream_proxy_process(ngx_stream_sess
         if (dst->type == SOCK_STREAM && pscf->half_close
             && src->read->eof && !u->half_closed && !dst->buffered)
         {
+
+#if (NGX_STREAM_QUIC)
+            if (dst->quic) {
+
+                if (ngx_quic_shutdown_stream(dst, NGX_WRITE_SHUTDOWN)
+                    != NGX_OK)
+                {
+                    ngx_stream_proxy_finalize(s,
+                                             NGX_STREAM_INTERNAL_SERVER_ERROR);
+                    return;
+                }
+
+            } else
+#endif
+
             if (ngx_shutdown_socket(dst->fd, NGX_WRITE_SHUTDOWN) == -1) {
                 ngx_connection_error(c, ngx_socket_errno,
                                      ngx_shutdown_socket_n " failed");