]> git.kaiwu.me - nginx.git/commitdiff
Reject new QUIC connection with CONNECTION_REFUSED on shutdown.
authorSergey Kandaurov <pluknet@nginx.com>
Tue, 23 Jun 2020 08:57:00 +0000 (11:57 +0300)
committerSergey Kandaurov <pluknet@nginx.com>
Tue, 23 Jun 2020 08:57:00 +0000 (11:57 +0300)
src/event/ngx_event_quic.c

index 95711bdfc8c0bf61f1744c556750e28c24ad8d13..1a2fdf2d5410ab3a6b9f9e4855d332c53419244d 100644 (file)
@@ -712,6 +712,11 @@ ngx_quic_new_connection(ngx_connection_t *c, ngx_ssl_t *ssl, ngx_quic_tp_t *tp,
 
     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);