mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-04 20:46:11 +02:00
MINOR: quic: Get rid of a struct buffer in quic_lstnr_dgram_read()
This is to be sure xprt functions do not manipulate the buffer struct passed as parameter to quic_lstnr_dgram_read() from low level datagram I/O callback in quic_sock.c (quic_sock_fd_iocb()).
This commit is contained in:
parent
055ee6c14b
commit
3d55462654
@ -1184,7 +1184,7 @@ void chunk_frm_appendf(struct buffer *buf, const struct quic_frame *frm);
|
||||
|
||||
void quic_set_tls_alert(struct quic_conn *qc, int alert);
|
||||
int quic_set_app_ops(struct quic_conn *qc, const unsigned char *alpn, size_t alpn_len);
|
||||
ssize_t quic_lstnr_dgram_read(struct buffer *buf, size_t len, void *owner,
|
||||
ssize_t quic_lstnr_dgram_read(unsigned char *buf, size_t len, void *owner,
|
||||
struct sockaddr_storage *saddr);
|
||||
|
||||
#endif /* USE_QUIC */
|
||||
|
||||
@ -212,7 +212,7 @@ void quic_sock_fd_iocb(int fd)
|
||||
} while (0);
|
||||
|
||||
b_add(buf, ret);
|
||||
quic_lstnr_dgram_read(buf, ret, l, &saddr);
|
||||
quic_lstnr_dgram_read((unsigned char *)b_head(buf), ret, l, &saddr);
|
||||
b_del(buf, ret);
|
||||
out:
|
||||
MT_LIST_APPEND(&l->rx.rxbuf_list, &rxbuf->mt_list);
|
||||
|
||||
@ -5527,7 +5527,7 @@ static void __quic_conn_deinit(void)
|
||||
* as owner calling <func> function.
|
||||
* Return the number of bytes read if succeeded, -1 if not.
|
||||
*/
|
||||
static ssize_t quic_dgram_read(struct buffer *buf, size_t len, void *owner,
|
||||
static ssize_t quic_dgram_read(unsigned char *buf, size_t len, void *owner,
|
||||
struct sockaddr_storage *saddr, qpkt_read_func *func)
|
||||
{
|
||||
unsigned char *pos;
|
||||
@ -5538,7 +5538,7 @@ static ssize_t quic_dgram_read(struct buffer *buf, size_t len, void *owner,
|
||||
.owner = owner,
|
||||
};
|
||||
|
||||
pos = (unsigned char *)b_head(buf);
|
||||
pos = buf;
|
||||
end = pos + len;
|
||||
do {
|
||||
int ret;
|
||||
@ -5563,13 +5563,13 @@ static ssize_t quic_dgram_read(struct buffer *buf, size_t len, void *owner,
|
||||
if (dgram_ctx.qc)
|
||||
dgram_ctx.qc->rx.bytes += len;
|
||||
|
||||
return pos - (unsigned char *)b_head(buf);
|
||||
return pos - buf;
|
||||
|
||||
err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
ssize_t quic_lstnr_dgram_read(struct buffer *buf, size_t len, void *owner,
|
||||
ssize_t quic_lstnr_dgram_read(unsigned char *buf, size_t len, void *owner,
|
||||
struct sockaddr_storage *saddr)
|
||||
{
|
||||
return quic_dgram_read(buf, len, owner, saddr, qc_lstnr_pkt_rcv);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user