diff src/http/v3/ngx_http_v3_uni.c @ 8986:6546c2ae1c7b quic

HTTP/3: unified hq code with regular HTTP/3 code. The change removes hq-specific request handler. Now hq requests are handled by the HTTP/3 request handler.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 19 Oct 2022 17:45:30 +0400
parents 37d5dddabaea
children c851a2ed5ce8
line wrap: on
line diff
--- a/src/http/v3/ngx_http_v3_uni.c
+++ b/src/http/v3/ngx_http_v3_uni.c
@@ -37,8 +37,23 @@ void
 ngx_http_v3_init_uni_stream(ngx_connection_t *c)
 {
     uint64_t                   n;
+#if (NGX_HTTP_V3_HQ)
+    ngx_http_v3_session_t     *h3c;
+#endif
     ngx_http_v3_uni_stream_t  *us;
 
+#if (NGX_HTTP_V3_HQ)
+    h3c = ngx_http_v3_get_session(c);
+    if (h3c->hq) {
+        ngx_http_v3_finalize_connection(c,
+                                        NGX_HTTP_V3_ERR_STREAM_CREATION_ERROR,
+                                        "uni stream in hq mode");
+        c->data = NULL;
+        ngx_http_v3_close_uni_stream(c);
+        return;
+    }
+#endif
+
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 init uni stream");
 
     n = c->quic->id >> 2;