From acb585518d868a5051c1caa85add006d975751f5 Mon Sep 17 00:00:00 2001 From: Roman Arutyunyan Date: Mon, 31 Jan 2022 09:16:47 +0300 Subject: QUIC: allowed main QUIC connection for some operations. Operations like ngx_quic_open_stream(), ngx_http_quic_get_connection(), ngx_http_v3_finalize_connection(), ngx_http_v3_shutdown_connection() used to receive a QUIC stream connection. Now they can receive the main QUIC connection as well. This is useful when calling them from a stream context. --- src/event/quic/ngx_event_quic_streams.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/event') diff --git a/src/event/quic/ngx_event_quic_streams.c b/src/event/quic/ngx_event_quic_streams.c index 2016c62a1..8928d4ea1 100644 --- a/src/event/quic/ngx_event_quic_streams.c +++ b/src/event/quic/ngx_event_quic_streams.c @@ -40,11 +40,12 @@ ngx_connection_t * ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi) { uint64_t id; - ngx_quic_stream_t *qs, *nqs; + ngx_connection_t *pc; + ngx_quic_stream_t *nqs; ngx_quic_connection_t *qc; - qs = c->quic; - qc = ngx_quic_get_connection(qs->parent); + pc = c->quic ? c->quic->parent : c; + qc = ngx_quic_get_connection(pc); if (bidi) { if (qc->streams.server_streams_bidi @@ -90,7 +91,7 @@ ngx_quic_open_stream(ngx_connection_t *c, ngx_uint_t bidi) qc->streams.server_streams_uni++; } - nqs = ngx_quic_create_stream(qs->parent, id); + nqs = ngx_quic_create_stream(pc, id); if (nqs == NULL) { return NULL; } -- cgit