mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-04 12:32:23 +00:00
REORG: quic: add comment on rare thread concurrence during CID alloc
The comment is here to warn about a possible thread concurrence issue when treating INITIAL packets from the same client. The macro unlikely is added to further highlight this scarce occurence.
This commit is contained in:
parent
cb318a80e4
commit
aff4ec86eb
@ -3771,18 +3771,22 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char **buf, const unsigned char *end,
|
||||
}
|
||||
HA_RWLOCK_WRUNLOCK(QUIC_LOCK, &l->rx.cids_lock);
|
||||
|
||||
if (n == &qc->odcid_node) {
|
||||
/* If the insertion failed, it means that another
|
||||
* thread has already allocated a QUIC connection for
|
||||
* the same CID. Liberate our allocated connection.
|
||||
*/
|
||||
if (unlikely(n != &qc->odcid_node)) {
|
||||
quic_conn_free(qc);
|
||||
qc = ebmb_entry(n, struct quic_conn, odcid_node);
|
||||
pkt->qc = qc;
|
||||
}
|
||||
else {
|
||||
/* Enqueue this packet. */
|
||||
pkt->qc = qc;
|
||||
MT_LIST_APPEND(&l->rx.pkts, &pkt->rx_list);
|
||||
/* Try to accept a new connection. */
|
||||
listener_accept(l);
|
||||
}
|
||||
else {
|
||||
quic_conn_free(qc);
|
||||
qc = ebmb_entry(n, struct quic_conn, odcid_node);
|
||||
pkt->qc = qc;
|
||||
}
|
||||
|
||||
/* This is the DCID node sent in this packet by the client. */
|
||||
node = &qc->odcid_node;
|
||||
|
Loading…
Reference in New Issue
Block a user