]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux_h2: Add missing braces in h2_snd_buf()around trace+wakeup
authorTim Duesterhus <tim@bastelstu.be>
Mon, 21 Dec 2020 18:40:16 +0000 (19:40 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 22 Dec 2020 08:02:11 +0000 (09:02 +0100)
This is a regression in 7838a79ba ("MEDIUM: mux-h2/trace: add lots of traces
all over the code"). The issue was found using -Wmisleading-indentation.
This patch fixes GitHub issue #1015.

The impact of this bug is that it could in theory cause occasional delays
on some long responses for connections having otherwise no traffic.

This patch should be backported to 2.1+, the commit was first tagged in
v2.1-dev2.

src/mux_h2.c

index c712eb3c23cee3d01abd71f8e2ce597634767648..e4fb6c3f219766b9a3b53f3be4a4dcd0398a137a 100644 (file)
@@ -6160,9 +6160,10 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
        htx_to_buf(htx, buf);
 
        if (total > 0) {
-               if (!(h2s->h2c->wait_event.events & SUB_RETRY_SEND))
+               if (!(h2s->h2c->wait_event.events & SUB_RETRY_SEND)) {
                        TRACE_DEVEL("data queued, waking up h2c sender", H2_EV_H2S_SEND|H2_EV_H2C_SEND, h2s->h2c->conn, h2s);
                        tasklet_wakeup(h2s->h2c->wait_event.tasklet);
+               }
 
        }
        /* If we're waiting for flow control, and we got a shutr on the