changeset 8443:3b5fbf1bcdee quic

Reject new QUIC connection with CONNECTION_REFUSED on shutdown.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 23 Jun 2020 11:57:00 +0300
parents b9bce2c4fe33
children 769d8bdeffb0
files src/event/ngx_event_quic.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/event/ngx_event_quic.c
+++ b/src/event/ngx_event_quic.c
@@ -712,6 +712,11 @@ ngx_quic_new_connection(ngx_connection_t
 
     qc->initialized = 1;
 
+    if (ngx_terminate || ngx_exiting) {
+        qc->error = NGX_QUIC_ERR_CONNECTION_REFUSED;
+        return NGX_ERROR;
+    }
+
     if (pkt->token.len) {
         rc = ngx_quic_validate_token(c, pkt);