comparison src/event/ngx_event_udp.c @ 8735:9ce6d80df113 quic

QUIC: simplified quic connection dispatching. Currently listener contains rbtree with multiple nodes for single QUIC connection: each corresponding to specific server id. Each udp node points to same ngx_connection_t, which points to QUIC connection via c->udp field. Thus when an event handler is called, it only gets ngx_connection_t with c->udp pointing to QUIC connection. This makes it hard to obtain actual node which was used to dispatch packet (it requires to repeat DCID lookup). Additionally, ngx_quic_connection_t->udp field is only needed to keep a pointer in c->udp. The node is not added into the tree and does not carry useful information.
author Vladimir Homutov <vl@nginx.com>
date Fri, 02 Apr 2021 11:31:37 +0300
parents c61fcdc1b8e3
children 7f95010f10b7
comparison
equal deleted inserted replaced
8734:c61fcdc1b8e3 8735:9ce6d80df113
682 rc = ngx_cmp_sockaddr(local_sockaddr, local_socklen, 682 rc = ngx_cmp_sockaddr(local_sockaddr, local_socklen,
683 c->local_sockaddr, c->local_socklen, 1); 683 c->local_sockaddr, c->local_socklen, 1);
684 } 684 }
685 685
686 if (rc == 0) { 686 if (rc == 0) {
687
688 #if (NGX_QUIC)
689 if (ls->quic && c->udp != udp) {
690 c->udp = udp;
691 }
692 #endif
693
687 return c; 694 return c;
688 } 695 }
689 696
690 node = (rc < 0) ? node->left : node->right; 697 node = (rc < 0) ? node->left : node->right;
691 } 698 }