mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-24 20:31:00 +01:00
MINOR: quic: Replace pool_zalloc() by pool_malloc() for fake datagrams
These fake datagrams are only used by the low level I/O handler. They are not provided to the "by connection" datagram handlers. This is why they are not MT_LIST_APPEND()ed to the listner RX buffer list (see &quic_dghdlrs[cid_tid].dgrams in quic_lstnr_dgram_dispatch(). Replace the call to pool_zalloc() to by the lighter call to pool_malloc() and initialize only the ->buf and ->length members. This is safe because only these fields are inspected by the low level I/O handler.
This commit is contained in:
parent
ffde3168fc
commit
ba19acd822
@ -317,7 +317,7 @@ void quic_sock_fd_iocb(int fd)
|
|||||||
struct quic_dgram *dgram;
|
struct quic_dgram *dgram;
|
||||||
|
|
||||||
/* Do no mark <buf> as full, and do not try to consume it
|
/* Do no mark <buf> as full, and do not try to consume it
|
||||||
* if the contiguous remmaining space is not at the end
|
* if the contiguous remaining space is not at the end
|
||||||
*/
|
*/
|
||||||
if (b_tail(buf) + cspace < b_wrap(buf))
|
if (b_tail(buf) + cspace < b_wrap(buf))
|
||||||
goto out;
|
goto out;
|
||||||
@ -325,11 +325,16 @@ void quic_sock_fd_iocb(int fd)
|
|||||||
/* Allocate a fake datagram, without data to locate
|
/* Allocate a fake datagram, without data to locate
|
||||||
* the end of the RX buffer (required during purging).
|
* the end of the RX buffer (required during purging).
|
||||||
*/
|
*/
|
||||||
dgram = pool_zalloc(pool_head_quic_dgram);
|
dgram = pool_alloc(pool_head_quic_dgram);
|
||||||
if (!dgram)
|
if (!dgram)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
/* Initialize only the useful members of this fake datagram. */
|
||||||
|
dgram->buf = NULL;
|
||||||
dgram->len = cspace;
|
dgram->len = cspace;
|
||||||
|
/* Append this datagram only to the RX buffer list. It will
|
||||||
|
* not be treated by any datagram handler.
|
||||||
|
*/
|
||||||
LIST_APPEND(&rxbuf->dgrams, &dgram->list);
|
LIST_APPEND(&rxbuf->dgrams, &dgram->list);
|
||||||
|
|
||||||
/* Consume the remaining space */
|
/* Consume the remaining space */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user