mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-21 19:01:00 +01:00
MINOR: mux-h2: obey http-ignore-probes during the preface
We're seeing some browsers setting up multiple connections and closing some to just keep one. It looks like they do this in case they'd negotiate H1. This results in aborted prefaces and log pollution about bad requests and "PR--" in the status flags. We already have an option to ignore connections with no data, it's called http-ignore-probes. But it was not used by the H2 mux. However it totally makes sense to use it during the preface. This patch changes this so that connections aborted before sending the preface can avoid being logged. This should be backported to 2.4 and 2.3 at least, and probably even as far as 2.0.
This commit is contained in:
parent
fc8e438637
commit
ee4684f65b
@ -1701,6 +1701,8 @@ static int h2c_frt_recv_preface(struct h2c *h2c)
|
||||
if (ret1 < 0 || conn_xprt_read0_pending(h2c->conn)) {
|
||||
TRACE_ERROR("I/O error or short read", H2_EV_RX_FRAME|H2_EV_RX_PREFACE, h2c->conn);
|
||||
h2c_error(h2c, H2_ERR_PROTOCOL_ERROR);
|
||||
if (b_data(&h2c->dbuf) ||
|
||||
!(((const struct session *)h2c->conn->owner)->fe->options & PR_O_IGNORE_PRB))
|
||||
HA_ATOMIC_INC(&h2c->px_counters->conn_proto_err);
|
||||
}
|
||||
ret2 = 0;
|
||||
@ -3128,6 +3130,8 @@ static void h2_process_demux(struct h2c *h2c)
|
||||
if (h2c->st0 == H2_CS_ERROR) {
|
||||
TRACE_PROTO("failed to receive preface", H2_EV_RX_PREFACE|H2_EV_PROTO_ERR, h2c->conn);
|
||||
h2c->st0 = H2_CS_ERROR2;
|
||||
if (b_data(&h2c->dbuf) ||
|
||||
!(((const struct session *)h2c->conn->owner)->fe->options & PR_O_IGNORE_PRB))
|
||||
sess_log(h2c->conn->owner);
|
||||
}
|
||||
goto fail;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user