A connection-level error must not be turned to a stream-level error if there
are still pending data for that stream, otherwise it can cause the truncation
of the last pending data.
This must be backported to affected releases, at least as far as 2.4,
maybe further.
(cherry picked from commit
99bbdbcc21355c8773474274a319086c0d2999d6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
3062447a332684cff7e247e316466729e8d34dbc)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
a352e82cb8e7fc98b321cc6b6b283a0ae96e100b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
if (!h1s_data_pending(h1s) && h1s && h1s->cs && h1s->cs->data_cb->wake &&
(h1s->flags & H1S_F_REOS || h1c->flags & H1C_F_CS_ERROR ||
conn->flags & (CO_FL_ERROR | CO_FL_SOCK_WR_SH))) {
- if (h1c->flags & H1C_F_CS_ERROR || conn->flags & CO_FL_ERROR)
+ if (h1c->flags & H1C_F_CS_ERROR || ((conn->flags & CO_FL_ERROR) && !b_data(&h1c->ibuf)))
h1s->cs->flags |= CS_FL_ERROR;
TRACE_POINT(H1_EV_STRM_WAKE, h1c->conn, h1s);
h1s->cs->data_cb->wake(h1s->cs);