]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: Don't forget to wake the tasklet after shutr/shutw.
authorOlivier Houchard <ohouchard@haproxy.com>
Mon, 3 Dec 2018 17:43:16 +0000 (18:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 4 Dec 2018 04:57:34 +0000 (05:57 +0100)
When reaching h2_shutr/h2_shutw, as we may have generated an empty frame,
a goaway or a rst, make sure we wake the I/O tasklet, or we may not send
what we just generated.
Also in h2_shutw(), don't forget to return if all went well, we don't want
to subscribe the h2s to wait events.

src/mux_h2.c

index b5800f33a669c914f99903976419560201c7d124..8d5c9de073788af7fa5a0cff207188c36912f99a 100644 (file)
@@ -2862,6 +2862,8 @@ static void h2_do_shutr(struct h2s *h2s)
            h2c_send_goaway_error(h2c, h2s) <= 0)
                return;
 
+       if (!(h2c->wait_event.wait_reason & SUB_CAN_SEND))
+               tasklet_wakeup(h2c->wait_event.task);
        h2s_close(h2s);
 
        return;
@@ -2918,6 +2920,9 @@ static void h2_do_shutw(struct h2s *h2s)
                h2s_close(h2s);
        }
 
+       if (!(h2c->wait_event.wait_reason & SUB_CAN_SEND))
+               tasklet_wakeup(h2c->wait_event.task);
+       return;
 
  add_to_list:
        if (LIST_ISEMPTY(&h2s->list)) {