comparison src/http/v3/ngx_http_v3_streams.c @ 8724:fc64ab301bad quic

QUIC: connection shutdown. The function ngx_quic_shutdown_connection() waits until all non-cancelable streams are closed, and then closes the connection. In HTTP/3 cancelable streams are all unidirectional streams except push streams. The function is called from HTTP/3 when client reaches keepalive_requests.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 15 Mar 2021 16:39:33 +0300
parents 265062a99043
children 98c4020f1c9a
comparison
equal deleted inserted replaced
8723:265062a99043 8724:fc64ab301bad
77 ngx_http_v3_init_uni_stream(ngx_connection_t *c) 77 ngx_http_v3_init_uni_stream(ngx_connection_t *c)
78 { 78 {
79 ngx_http_v3_uni_stream_t *us; 79 ngx_http_v3_uni_stream_t *us;
80 80
81 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 init uni stream"); 81 ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "http3 init uni stream");
82
83 c->quic->cancelable = 1;
82 84
83 us = ngx_pcalloc(c->pool, sizeof(ngx_http_v3_uni_stream_t)); 85 us = ngx_pcalloc(c->pool, sizeof(ngx_http_v3_uni_stream_t));
84 if (us == NULL) { 86 if (us == NULL) {
85 ngx_http_close_connection(c); 87 ngx_http_close_connection(c);
86 return; 88 return;
434 sc = ngx_quic_open_stream(c, 0); 436 sc = ngx_quic_open_stream(c, 0);
435 if (sc == NULL) { 437 if (sc == NULL) {
436 return NULL; 438 return NULL;
437 } 439 }
438 440
441 sc->quic->cancelable = 1;
442
439 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, 443 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
440 "http3 create uni stream, type:%ui", type); 444 "http3 create uni stream, type:%ui", type);
441 445
442 us = ngx_pcalloc(sc->pool, sizeof(ngx_http_v3_uni_stream_t)); 446 us = ngx_pcalloc(sc->pool, sizeof(ngx_http_v3_uni_stream_t));
443 if (us == NULL) { 447 if (us == NULL) {