diff src/event/quic/ngx_event_quic.c @ 9017:c2f5d79cde64 quic

QUIC: separate UDP framework for QUIC. Previously, QUIC used the existing UDP framework, which was created for UDP in Stream. However the way QUIC connections are created and looked up is different from the way UDP connections in Stream are created and looked up. Now these two implementations are decoupled.
author Roman Arutyunyan <arut@nginx.com>
date Wed, 20 Apr 2022 16:01:17 +0400
parents a2fbae359828
children f2925c80401c
line wrap: on
line diff
--- a/src/event/quic/ngx_event_quic.c
+++ b/src/event/quic/ngx_event_quic.c
@@ -430,7 +430,7 @@ ngx_quic_input_handler(ngx_event_t *rev)
         return;
     }
 
-    b = c->udp->dgram->buffer;
+    b = c->udp->buffer;
 
     rc = ngx_quic_handle_datagram(c, b, NULL);
 
@@ -758,6 +758,7 @@ ngx_quic_handle_packet(ngx_connection_t 
     ngx_quic_header_t *pkt)
 {
     ngx_int_t               rc;
+    ngx_quic_socket_t      *qsock;
     ngx_quic_connection_t  *qc;
 
     c->log->action = "parsing quic packet";
@@ -809,8 +810,9 @@ ngx_quic_handle_packet(ngx_connection_t 
             }
 
             if (pkt->first) {
-                if (ngx_cmp_sockaddr(c->udp->dgram->sockaddr,
-                                     c->udp->dgram->socklen,
+                qsock = ngx_quic_get_socket(c);
+
+                if (ngx_cmp_sockaddr(&qsock->sockaddr.sockaddr, qsock->socklen,
                                      qc->path->sockaddr, qc->path->socklen, 1)
                     != NGX_OK)
                 {