mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-26 08:11:21 +02:00
MINOR: h3: fix compiler warning variable set but not used
Some variables were only checked via BUG_ON macro. If compiling without DEBUG_STRICT, this instruction is a noop. Fix this by using an explicit condition + ABORT_NOW. This should fix the github issue #1549.
This commit is contained in:
parent
d1c76f24fd
commit
ff191de1ca
13
src/h3.c
13
src/h3.c
@ -211,11 +211,14 @@ static int h3_data_to_htx(struct qcs *qcs, struct buffer *buf, uint64_t len,
|
|||||||
htx = htx_from_buf(appbuf);
|
htx = htx_from_buf(appbuf);
|
||||||
|
|
||||||
htx_space = htx_free_data_space(htx);
|
htx_space = htx_free_data_space(htx);
|
||||||
BUG_ON(!htx_space || htx_space < len);
|
if (!htx_space || htx_space < len) {
|
||||||
|
ABORT_NOW(); /* TODO handle this case properly */
|
||||||
|
}
|
||||||
|
|
||||||
htx_sent = htx_add_data(htx, ist2(b_head(buf), len));
|
htx_sent = htx_add_data(htx, ist2(b_head(buf), len));
|
||||||
/* TODO handle full appbuf */
|
if (htx_sent < len) {
|
||||||
BUG_ON(htx_sent < len);
|
ABORT_NOW(); /* TODO handle this case properly */
|
||||||
|
}
|
||||||
|
|
||||||
if (fin)
|
if (fin)
|
||||||
htx->flags |= HTX_FL_EOM;
|
htx->flags |= HTX_FL_EOM;
|
||||||
@ -264,12 +267,12 @@ static int h3_decode_qcs(struct qcs *qcs, int fin, void *ctx)
|
|||||||
case H3_FT_DATA:
|
case H3_FT_DATA:
|
||||||
ret = h3_data_to_htx(qcs, rxbuf, flen, last_stream_frame);
|
ret = h3_data_to_htx(qcs, rxbuf, flen, last_stream_frame);
|
||||||
/* TODO handle error reporting. Stream closure required. */
|
/* TODO handle error reporting. Stream closure required. */
|
||||||
BUG_ON(ret);
|
if (ret) { ABORT_NOW(); }
|
||||||
break;
|
break;
|
||||||
case H3_FT_HEADERS:
|
case H3_FT_HEADERS:
|
||||||
ret = h3_headers_to_htx(qcs, rxbuf, flen, last_stream_frame);
|
ret = h3_headers_to_htx(qcs, rxbuf, flen, last_stream_frame);
|
||||||
/* TODO handle error reporting. Stream closure required. */
|
/* TODO handle error reporting. Stream closure required. */
|
||||||
BUG_ON(ret);
|
if (ret) { ABORT_NOW(); }
|
||||||
break;
|
break;
|
||||||
case H3_FT_PUSH_PROMISE:
|
case H3_FT_PUSH_PROMISE:
|
||||||
/* Not supported */
|
/* Not supported */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user