Mercurial > hg > nginx
diff src/http/v3/ngx_http_v3_uni.c @ 9051:37d5dddabaea quic
QUIC: reusable mode for main connection.
The connection is automatically switched to this mode by transport layer when
there are no non-cancelable streams. Currently, cancelable streams are
HTTP/3 encoder/decoder/control streams.
author | Roman Arutyunyan <arut@nginx.com> |
---|---|
date | Tue, 29 Nov 2022 17:46:46 +0400 |
parents | a5aebd51e4c7 |
children | 6546c2ae1c7b |
line wrap: on
line diff
--- a/src/http/v3/ngx_http_v3_uni.c Wed Sep 07 19:25:13 2022 +0400 +++ b/src/http/v3/ngx_http_v3_uni.c Tue Nov 29 17:46:46 2022 +0400 @@ -52,7 +52,7 @@ return; } - c->quic->cancelable = 1; + ngx_quic_cancelable_stream(c); us = ngx_pcalloc(c->pool, sizeof(ngx_http_v3_uni_stream_t)); if (us == NULL) { @@ -182,6 +182,11 @@ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 read handler"); + if (c->close) { + ngx_http_v3_close_uni_stream(c); + return; + } + ngx_memzero(&b, sizeof(ngx_buf_t)); while (rev->ready) { @@ -262,6 +267,11 @@ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 dummy read handler"); + if (c->close) { + ngx_http_v3_close_uni_stream(c); + return; + } + if (rev->ready) { if (c->recv(c, &ch, 1) != 0) { ngx_http_v3_finalize_connection(c, NGX_HTTP_V3_ERR_NO_ERROR, NULL); @@ -404,7 +414,7 @@ goto failed; } - sc->quic->cancelable = 1; + ngx_quic_cancelable_stream(sc); ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 create uni stream, type:%ui", type);