]> git.kaiwu.me - nginx.git/commitdiff
QUIC: removed unnecessary closing of active/backup sockets.
authorVladimir Homutov <vl@nginx.com>
Thu, 18 Nov 2021 11:33:21 +0000 (14:33 +0300)
committerVladimir Homutov <vl@nginx.com>
Thu, 18 Nov 2021 11:33:21 +0000 (14:33 +0300)
All open sockets are stored in a queue.  There is no need to close some
of them separately.  If it happens that active and backup point to same
socket, double close may happen (leading to possible segfault).

src/event/quic/ngx_event_quic_socket.c

index 3b507fca8104e3fd67033140a09b2857a4e9bb22..4a9fb232dbab6e1f65974b01896a61453296ab4a 100644 (file)
@@ -288,12 +288,6 @@ ngx_quic_close_sockets(ngx_connection_t *c)
 
     qc = ngx_quic_get_connection(c);
 
-    ngx_quic_close_socket(c, qc->socket);
-
-    if (qc->backup) {
-        ngx_quic_close_socket(c, qc->backup);
-    }
-
     while (!ngx_queue_empty(&qc->sockets)) {
         q = ngx_queue_head(&qc->sockets);
         qsock = ngx_queue_data(q, ngx_quic_socket_t, queue);