mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 15:21:29 +02:00
MINOR: h3: do not wait a complete frame for demuxing
Previously, H3 demuxer refused to proceed the payload if the frame was not entirely received and the QCS buffer is not full. This code was duplicated from the H2 demuxer. In H2, this is a justified optimization as only one frame at a time can be demuxed. However, this is not the case in H3 with interleaved frames in the lower layer QUIC STREAM frames. This condition is now removed. H3 demuxer will proceed payload as soon as possible. An exception is kept for HEADERS frame as the code is not able to deal with partial HEADERS. With this change, H3 demuxer should consume less memory. To ensure that we never received a HEADER bigger than the RX buffer, we should use the H3 SETTINGS_MAX_FIELD_SECTION_SIZE.
This commit is contained in:
parent
03dcf560ae
commit
b5454d42df
5
src/h3.c
5
src/h3.c
@ -288,8 +288,11 @@ static int h3_decode_qcs(struct qcs *qcs, int fin, void *ctx)
|
||||
|
||||
flen = h3s->demux_frame_len;
|
||||
ftype = h3s->demux_frame_type;
|
||||
if (flen > b_data(&b) && !ncb_is_full(rxbuf))
|
||||
/* Do not demux HEADERS if frame incomplete. */
|
||||
if (ftype == H3_FT_HEADERS && flen > b_data(&b)) {
|
||||
BUG_ON(ncb_is_full(rxbuf)); /* TODO should define SETTINGS for max header size */
|
||||
break;
|
||||
}
|
||||
last_stream_frame = (fin && flen == ncb_total_data(rxbuf));
|
||||
|
||||
switch (ftype) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user