BUG/MEDIUM: mux-h1: Add connection error handling when reading/sending on a pipe
There is no error handling when we read or write on a pipe. There error is caught later, in the mux I/O handler. But there is no reason to not do so here. There is no reason to backport it because no issue was reported for now because of this "bug". In all cases, it must be evaluated first.
This commit is contained in:
parent
c8db114afc
commit
9009c974c1
11
src/mux_h1.c
11
src/mux_h1.c
|
@ -3760,6 +3760,11 @@ static int h1_rcv_pipe(struct stconn *sc, struct pipe *pipe, unsigned int count)
|
||||||
h1c->flags &= ~H1C_F_WANT_SPLICE;
|
h1c->flags &= ~H1C_F_WANT_SPLICE;
|
||||||
TRACE_STATE("Allow xprt rcv_buf on read0", H1_EV_STRM_RECV, h1c->conn, h1s);
|
TRACE_STATE("Allow xprt rcv_buf on read0", H1_EV_STRM_RECV, h1c->conn, h1s);
|
||||||
}
|
}
|
||||||
|
if (h1c->conn->flags & CO_FL_ERROR) {
|
||||||
|
se_fl_set(h1s->sd, SE_FL_ERROR);
|
||||||
|
h1c->flags = (h1c->flags & ~H1C_F_WANT_SPLICE) | H1C_F_ST_ERROR;
|
||||||
|
TRACE_DEVEL("connection error", H1_EV_STRM_ERR|H1_EV_H1C_ERR|H1_EV_H1S_ERR, h1c->conn, h1s);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(h1c->flags & H1C_F_WANT_SPLICE)) {
|
if (!(h1c->flags & H1C_F_WANT_SPLICE)) {
|
||||||
TRACE_STATE("notify the mux can't use splicing anymore", H1_EV_STRM_RECV, h1c->conn, h1s);
|
TRACE_STATE("notify the mux can't use splicing anymore", H1_EV_STRM_RECV, h1c->conn, h1s);
|
||||||
|
@ -3811,6 +3816,12 @@ static int h1_snd_pipe(struct stconn *sc, struct pipe *pipe)
|
||||||
HA_ATOMIC_ADD(&h1c->px_counters->spliced_bytes_out, ret);
|
HA_ATOMIC_ADD(&h1c->px_counters->spliced_bytes_out, ret);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
|
if (h1c->conn->flags & CO_FL_ERROR) {
|
||||||
|
se_fl_set(h1s->sd, SE_FL_ERROR);
|
||||||
|
h1c->flags = (h1c->flags & ~H1C_F_WANT_SPLICE) | H1C_F_ST_ERROR;
|
||||||
|
TRACE_DEVEL("connection error", H1_EV_STRM_ERR|H1_EV_H1C_ERR|H1_EV_H1S_ERR, h1c->conn, h1s);
|
||||||
|
}
|
||||||
|
|
||||||
TRACE_LEAVE(H1_EV_STRM_SEND, h1c->conn, h1s, 0, (size_t[]){ret});
|
TRACE_LEAVE(H1_EV_STRM_SEND, h1c->conn, h1s, 0, (size_t[]){ret});
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue