]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: Don't emit log twice if an error occurred on the preface
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 15 Mar 2021 16:54:31 +0000 (17:54 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Apr 2021 06:56:07 +0000 (08:56 +0200)
sess_log() was called twice if an error occurred on the preface parsing, in
h2c_frt_recv_preface() and in h2_process_demux().

This patch must be backported as far as 2.0.

src/mux_h2.c

index 06abbc123cdc831769d837c1383fd6bf8cc015f9..235eb6d8d422e6a8c9a8229c3b17323afa1c1b07 100644 (file)
@@ -1681,9 +1681,6 @@ static int h2c_frt_recv_preface(struct h2c *h2c)
        ret1 = b_isteq(&h2c->dbuf, 0, b_data(&h2c->dbuf), ist(H2_CONN_PREFACE));
 
        if (unlikely(ret1 <= 0)) {
-               if (ret1 < 0)
-                       sess_log(h2c->conn->owner);
-
                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);