mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-09 00:27:08 +02:00
MINOR: quic: Replace the RX list of packet by a thread safety one.
This list is shared between the I/O dgram handler and the task responsible for processing the QUIC packets.
This commit is contained in:
parent
1eaec33cb5
commit
c28aba2a8d
@ -62,7 +62,7 @@ struct receiver {
|
|||||||
struct rx_settings *settings; /* points to the settings used by this receiver */
|
struct rx_settings *settings; /* points to the settings used by this receiver */
|
||||||
struct list proto_list; /* list in the protocol header */
|
struct list proto_list; /* list in the protocol header */
|
||||||
#ifdef USE_QUIC
|
#ifdef USE_QUIC
|
||||||
struct list qpkts; /* QUIC Initial packets to accept new connections */
|
struct mt_list pkts; /* QUIC Initial packets to accept new connections */
|
||||||
struct eb_root odcids; /* QUIC original destination connection IDs. */
|
struct eb_root odcids; /* QUIC original destination connection IDs. */
|
||||||
struct eb_root cids; /* QUIC connection IDs. */
|
struct eb_root cids; /* QUIC connection IDs. */
|
||||||
#endif
|
#endif
|
||||||
|
@ -395,7 +395,7 @@ extern struct quic_transport_params quic_dflt_transport_params;
|
|||||||
|
|
||||||
struct quic_rx_packet {
|
struct quic_rx_packet {
|
||||||
struct list list;
|
struct list list;
|
||||||
struct list rx_list;
|
struct mt_list rx_list;
|
||||||
struct quic_conn *qc;
|
struct quic_conn *qc;
|
||||||
unsigned char type;
|
unsigned char type;
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
|
@ -514,7 +514,7 @@ int quic_connect_server(struct connection *conn, int flags)
|
|||||||
*/
|
*/
|
||||||
static void quic_add_listener(struct protocol *proto, struct listener *listener)
|
static void quic_add_listener(struct protocol *proto, struct listener *listener)
|
||||||
{
|
{
|
||||||
LIST_INIT(&listener->rx.qpkts);
|
MT_LIST_INIT(&listener->rx.pkts);
|
||||||
listener->rx.odcids = EB_ROOT_UNIQUE;
|
listener->rx.odcids = EB_ROOT_UNIQUE;
|
||||||
listener->rx.cids = EB_ROOT_UNIQUE;
|
listener->rx.cids = EB_ROOT_UNIQUE;
|
||||||
default_add_listener(proto, listener);
|
default_add_listener(proto, listener);
|
||||||
|
@ -145,13 +145,12 @@ struct connection *quic_sock_accept_conn(struct listener *l, int *status)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
qc = NULL;
|
qc = NULL;
|
||||||
pkt = LIST_ELEM(l->rx.qpkts.n, struct quic_rx_packet *, rx_list);
|
pkt = MT_LIST_POP(&l->rx.pkts, struct quic_rx_packet *, rx_list);
|
||||||
/* Should never happen. */
|
/* Should never happen. */
|
||||||
if (&pkt->rx_list == &l->rx.qpkts)
|
if (!pkt)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
qc = pkt->qc;
|
qc = pkt->qc;
|
||||||
LIST_DELETE(&pkt->rx_list);
|
|
||||||
if (!new_quic_cli_conn(qc, l, &pkt->saddr))
|
if (!new_quic_cli_conn(qc, l, &pkt->saddr))
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
|
@ -3399,7 +3399,7 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char **buf, const unsigned char *end,
|
|||||||
}
|
}
|
||||||
else if (!found_conn) {
|
else if (!found_conn) {
|
||||||
/* Enqueue this packet. */
|
/* Enqueue this packet. */
|
||||||
LIST_APPEND(&l->rx.qpkts, &pkt->rx_list);
|
MT_LIST_APPEND(&l->rx.pkts, &pkt->rx_list);
|
||||||
/* Try to accept a new connection. */
|
/* Try to accept a new connection. */
|
||||||
listener_accept(l);
|
listener_accept(l);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user