aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_quic_module.c
diff options
context:
space:
mode:
authorRoman Arutyunyan <arut@nginx.com>2021-11-11 19:07:00 +0300
committerRoman Arutyunyan <arut@nginx.com>2021-11-11 19:07:00 +0300
commit50dd9ba7e85a8d4eeecaad8776f83adc607fd132 (patch)
tree0d5450012d518fb8c1a170325710ad1bc26b9203 /src/http/modules/ngx_http_quic_module.c
parent54655cebbb99693c7f05b689eb450a2c47ca79eb (diff)
downloadnginx-50dd9ba7e85a8d4eeecaad8776f83adc607fd132.tar.gz
nginx-50dd9ba7e85a8d4eeecaad8776f83adc607fd132.zip
QUIC: reject streams which we could not create.
The reasons why a stream may not be created by server currently include hitting worker_connections limit and memory allocation error. Previously in these cases the entire QUIC connection was closed and all its streams were shut down. Now the new stream is rejected and existing streams continue working. To reject an HTTP/3 request stream, RESET_STREAM and STOP_SENDING with H3_REQUEST_REJECTED error code are sent to client. HTTP/3 uni streams and Stream streams are not rejected.
Diffstat (limited to 'src/http/modules/ngx_http_quic_module.c')
-rw-r--r--src/http/modules/ngx_http_quic_module.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_quic_module.c b/src/http/modules/ngx_http_quic_module.c
index 9e6d17ead..323ee2ead 100644
--- a/src/http/modules/ngx_http_quic_module.c
+++ b/src/http/modules/ngx_http_quic_module.c
@@ -314,6 +314,7 @@ ngx_http_quic_create_srv_conf(ngx_conf_t *cf)
* conf->tp.sr_enabled = 0
* conf->tp.preferred_address = NULL
* conf->host_key = { 0, NULL }
+ * cong->stream_reject_code_uni = 0;
*/
conf->tp.max_idle_timeout = NGX_CONF_UNSET_MSEC;
@@ -331,6 +332,8 @@ ngx_http_quic_create_srv_conf(ngx_conf_t *cf)
conf->retry = NGX_CONF_UNSET;
conf->gso_enabled = NGX_CONF_UNSET;
+ conf->stream_close_code = NGX_HTTP_V3_ERR_NO_ERROR;
+ conf->stream_reject_code_bidi = NGX_HTTP_V3_ERR_REQUEST_REJECTED;
return conf;
}