diff --git a/src/h1_htx.c b/src/h1_htx.c index 3d74a4c99..61a60eeb5 100644 --- a/src/h1_htx.c +++ b/src/h1_htx.c @@ -878,8 +878,14 @@ int h1_parse_msg_tlrs(struct h1m *h1m, struct htx *dsthtx, struct h1m tlr_h1m; int ret = 0; - if (!max || !b_data(srcbuf)) + if (b_data(srcbuf) == ofs) { + /* Nothing to parse */ goto end; + } + if (!max) { + /* No more room */ + goto output_full; + } /* Realing input buffer if necessary */ if (b_peek(srcbuf, ofs) > b_tail(srcbuf)) diff --git a/src/mux_h1.c b/src/mux_h1.c index cd5f3fb73..79fdb553a 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -1709,7 +1709,7 @@ static size_t h1_handle_trailers(struct h1s *h1s, struct h1m *h1m, struct htx *h TRACE_ERROR("parsing error, reject H1 message", H1_EV_RX_DATA|H1_EV_RX_TLRS|H1_EV_H1S_ERR, h1s->h1c->conn, h1s); h1_capture_bad_message(h1s->h1c, h1s, h1m, buf); } - else if (ret == -2 || b_data(buf) != *ofs) { + else if (ret == -2) { TRACE_STATE("RX path congested, waiting for more space", H1_EV_RX_DATA|H1_EV_RX_TLRS|H1_EV_H1S_BLK, h1s->h1c->conn, h1s); h1s->flags |= H1S_F_RX_CONGESTED; }