Skip to content

Commit 37f09e7

Browse files
committed
MINOR: mux_quic: report fatal error on QMux frame type parsing issue
QMux frames are now enclosed in an intermediary Record layer. A benefit of this change is that this ensures frames will be wholly read. As such, qc_parse_frm_type() should not fail anymore when parsing QMux frames due to an incomplete type field. In this case, rxbuf is now cleared and a fatal error is reported to the caller.
1 parent 7cab3a3 commit 37f09e7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/qcm_qmux.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ static int qmux_parse_frm(struct qcc *qcc, struct buffer *buf)
4646
old = pos = (unsigned char *)b_head(buf);
4747
end = (unsigned char *)b_head(buf) + b_data(buf);
4848
ret = qc_parse_frm_type(&frm, &pos, end, NULL);
49-
if (!ret)
50-
return 0;
49+
if (!ret) {
50+
/* TODO close connection with FRAME_ENCODING_ERROR */
51+
b_reset(buf);
52+
return -1;
53+
}
5154

5255
if (!qmux_is_frm_valid(&frm)) {
5356
/* TODO close connection with FRAME_ENCODING_ERROR */

0 commit comments

Comments
 (0)