]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: h2: wake the connection up for send on pending streams
authorWilly Tarreau <w@1wt.eu>
Tue, 17 Oct 2017 13:30:07 +0000 (15:30 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:16:17 +0000 (18:16 +0100)
If some streams were blocked on flow control and the connection's
window was recently opened, or if some streams are waiting while
no block flag remains, we immediately want to try to send again.
This can happen if a recv() for a stream wants to send after the
send() loop has already been processed.

src/mux_h2.c

index ed891d6e103fbeed28a05b68f1e3cb19ce0722cf..9776deaa310ff10f55006f051b2e20c45d0925a4 100644 (file)
@@ -739,8 +739,11 @@ static int h2_wake(struct connection *conn)
        }
 
        /* adjust output polling */
-       if ((h2c->st0 == H2_CS_ERROR || h2c->mbuf->o) &&
-           !(conn->flags & CO_FL_SOCK_WR_SH)) {
+       if (!(conn->flags & CO_FL_SOCK_WR_SH) &&
+           (h2c->st0 == H2_CS_ERROR ||
+            h2c->mbuf->o ||
+            (h2c->mws > 0 && !LIST_ISEMPTY(&h2c->fctl_list)) ||
+            (!(h2c->flags & H2_CF_MUX_BLOCK_ANY) && !LIST_ISEMPTY(&h2c->send_list)))) {
                /* FIXME: we should (re-)arm a send timeout here */
                __conn_xprt_want_send(conn);
        }