aboutsummaryrefslogtreecommitdiff
path: root/src/http/v3/ngx_http_v3_request.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-10-18 14:48:11 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-10-18 14:48:11 +0300
commit5c99f43e6f6f2e97a625bf00330f2f8d5af29815 (patch)
treefb49453aca6dc83c26c1d4937332cfee19b279d5 /src/http/v3/ngx_http_v3_request.c
parenta6fb8fe85077bd10e11231c70ece803284890520 (diff)
downloadnginx-5c99f43e6f6f2e97a625bf00330f2f8d5af29815.tar.gz
nginx-5c99f43e6f6f2e97a625bf00330f2f8d5af29815.zip
HTTP/3: send Stream Cancellation instruction.
As per quic-qpack-21: When a stream is reset or reading is abandoned, the decoder emits a Stream Cancellation instruction. Previously the instruction was not sent. Now it's sent when closing QUIC stream connection if dynamic table capacity is non-zero and eof was not received from client. The latter condition means that a trailers section may still be on its way from client and the stream needs to be cancelled.
Diffstat (limited to 'src/http/v3/ngx_http_v3_request.c')
-rw-r--r--src/http/v3/ngx_http_v3_request.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/http/v3/ngx_http_v3_request.c b/src/http/v3/ngx_http_v3_request.c
index 6f980ed0b..e0c3a71ba 100644
--- a/src/http/v3/ngx_http_v3_request.c
+++ b/src/http/v3/ngx_http_v3_request.c
@@ -279,6 +279,14 @@ ngx_http_v3_wait_request_handler(ngx_event_t *rev)
void
ngx_http_v3_reset_connection(ngx_connection_t *c)
{
+ ngx_http_v3_srv_conf_t *h3scf;
+
+ h3scf = ngx_http_v3_get_module_srv_conf(c, ngx_http_v3_module);
+
+ if (h3scf->max_table_capacity > 0 && !c->read->eof) {
+ (void) ngx_http_v3_send_cancel_stream(c, c->quic->id);
+ }
+
if (c->timedout) {
ngx_quic_reset_stream(c, NGX_HTTP_V3_ERR_GENERAL_PROTOCOL_ERROR);