diff --git a/src/mux_h1.c b/src/mux_h1.c index cd4dc39d5..fe3f20be9 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -3729,6 +3729,9 @@ static size_t h1_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in else TRACE_DEVEL("h1c obuf not allocated", H1_EV_STRM_SEND|H1_EV_H1S_BLK, h1c->conn, h1s); + if ((h1c->conn->flags & (CO_FL_ERROR|CO_FL_SOCK_WR_SH))) + break; + if ((count - ret) > 0) h1c->flags |= H1C_F_CO_MSG_MORE; @@ -3740,7 +3743,7 @@ static size_t h1_snd_buf(struct stconn *sc, struct buffer *buf, size_t count, in break; } - if (h1c->flags & H1C_F_ST_ERROR) { + if (h1c->flags & H1C_F_ST_ERROR || ((h1c->conn->flags & CO_FL_ERROR) && !b_data(&h1c->ibuf))) { se_fl_set(h1s->sd, SE_FL_ERROR); TRACE_ERROR("reporting error to the app-layer stream", H1_EV_STRM_SEND|H1_EV_H1S_ERR|H1_EV_STRM_ERR, h1c->conn, h1s); }