]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h2: Obey dontlognull option during the preface
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 26 Jul 2021 08:18:35 +0000 (10:18 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 26 Jul 2021 13:14:35 +0000 (15:14 +0200)
If a connection is closed during the preface while no data are received, if
the dontlognull option is set, no log message must be emitted. However, this
will still be handled as a protocol error. Only the log is omitted.

This patch should fix the issue #1336 for H2 sessions. It must be backported
to 2.4 and 2.3 at least, and probably as far as 2.0.

src/mux_h2.c

index fbc79634b6bfd85ec503e5d1cf2d85e0d0cad4ea..85c8a3fc5b90f6d7f8ce14d136d8b8ff6e052552 100644 (file)
@@ -3133,7 +3133,7 @@ static void h2_process_demux(struct h2c *h2c)
                                        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))
+                                           !(((const struct session *)h2c->conn->owner)->fe->options & (PR_O_NULLNOLOG|PR_O_IGNORE_PRB)))
                                                sess_log(h2c->conn->owner);
                                }
                                goto fail;