 +            c->quic->handler = ngx_http_close_connection;
 +            return;
 +        }
++
++        if (c->destroyed) {
++            return;
++        }
 +    }
 +
 +#endif
 +
  #if (NGX_HTTP_SSL)
-
+ 
      if (c->ssl) {
 diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h
 index fce70efe6..8ac19658c 100644

     unsigned                   proxy_protocol:1;
+    unsigned                   quic:1;
 };


@@ -268,6 +270,7 @@ typedef struct {
     ngx_int_t                  family;
     in_port_t                  port;
     ngx_array_t                addrs;     /* array of ngx_http_conf_addr_t */
+    ngx_int_t                  type;
 } ngx_http_conf_port_t;


diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 80c19656f..1df32a397 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -64,6 +64,10 @@ static void ngx_http_ssl_handshake(ngx_event_t *rev);
 static void ngx_http_ssl_handshake_handler(ngx_connection_t *c);
 #endif

+#if (NGX_HTTP_V3)
+static void ngx_http_quic_handshake(ngx_event_t *rev);
+#endif
+

 static char *ngx_http_client_errors[] = {

@@ -349,6 +353,18 @@ ngx_http_init_connection(ngx_connection_t *c)
         c->log->action = "reading PROXY protocol";
     }

+#if (NGX_HTTP_V3)
+    if (hc->addr_conf->quic) {
+        hc->quic = 1;

             NGX_POST_CONF_MSG="$NGX_POST_CONF_MSG
 $0: warning: the \"--with-md5\" option is deprecated"
@@ -440,6 +448,7 @@ cat << END
 
   --with-http_ssl_module             enable ngx_http_ssl_module
   --with-http_v2_module              enable ngx_http_v2_module
+  --with-http_v3_module              enable ngx_http_v3_module
