comparison src/http/ngx_http.c @ 9107:adcc6d8acfd4 quic

Common tree insert function for QUIC and UDP connections. Previously, ngx_udp_rbtree_insert_value() was used for plain UDP and ngx_quic_rbtree_insert_value() was used for QUIC. Because of this it was impossible to initialize connection tree in ngx_create_listening() since this function is not aware what kind of listening it creates. Now ngx_udp_rbtree_insert_value() is used for both QUIC and UDP. To make is possible, a generic key field is added to ngx_udp_connection_t. It keeps client address for UDP and connection ID for QUIC.
author Roman Arutyunyan <arut@nginx.com>
date Sun, 14 May 2023 12:30:11 +0400
parents 69bae2437d74
children
comparison
equal deleted inserted replaced
9106:113e2438dbd4 9107:adcc6d8acfd4
1881 #endif 1881 #endif
1882 1882
1883 ls->wildcard = addr->opt.wildcard; 1883 ls->wildcard = addr->opt.wildcard;
1884 1884
1885 #if (NGX_HTTP_V3) 1885 #if (NGX_HTTP_V3)
1886
1887 ls->quic = addr->opt.quic; 1886 ls->quic = addr->opt.quic;
1888
1889 if (ls->quic) {
1890 ngx_rbtree_init(&ls->rbtree, &ls->sentinel,
1891 ngx_quic_rbtree_insert_value);
1892 }
1893
1894 #endif 1887 #endif
1895 1888
1896 return ls; 1889 return ls;
1897 } 1890 }
1898 1891