MINOR: quic: Do not reset a full RX buffer
As the RX buffer is not consumed by the sock i/o handler as soon as a datagram is produced, when full an RX buffer must not be reset. The remaining room is consumed without modifying it. The consumer has a represention of its contents: a list of datagrams.
This commit is contained in:
parent
37ae505c21
commit
320744b53d
@ -173,7 +173,7 @@ void quic_sock_fd_iocb(int fd)
|
|||||||
struct quic_transport_params *params;
|
struct quic_transport_params *params;
|
||||||
/* Source address */
|
/* Source address */
|
||||||
struct sockaddr_storage saddr = {0};
|
struct sockaddr_storage saddr = {0};
|
||||||
size_t max_sz;
|
size_t max_sz, cspace;
|
||||||
socklen_t saddrlen;
|
socklen_t saddrlen;
|
||||||
struct quic_dgram *dgram, *dgramp, *new_dgram;
|
struct quic_dgram *dgram, *dgramp, *new_dgram;
|
||||||
|
|
||||||
@ -207,9 +207,10 @@ void quic_sock_fd_iocb(int fd)
|
|||||||
|
|
||||||
params = &l->bind_conf->quic_params;
|
params = &l->bind_conf->quic_params;
|
||||||
max_sz = params->max_udp_payload_size;
|
max_sz = params->max_udp_payload_size;
|
||||||
if (b_contig_space(buf) < max_sz) {
|
cspace = b_contig_space(buf);
|
||||||
/* Note that when we enter this function, <buf> is always empty */
|
if (cspace < max_sz) {
|
||||||
b_reset(buf);
|
/* Consume the remaining space */
|
||||||
|
b_add(buf, cspace);
|
||||||
if (b_contig_space(buf) < max_sz)
|
if (b_contig_space(buf) < max_sz)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user