]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: Don't wait for flow control if the connection had a shutr.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 19 Dec 2018 17:16:17 +0000 (18:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Dec 2018 17:35:40 +0000 (18:35 +0100)
In h2_snd_buf(), if we couldn't send the data because of flow control, and
the connection got a shutr, then add CS_FL_ERROR (or CS_FL_ERR_PENDING). We
will never get any window update, so we will never be unlocked, anyway.

No backport is needed.

src/mux_h2.c

index faa5d0bcc2e7a6f5efdab6c61dd50ecd36beb993..0b28c38c95f2a58a6a31b76902e8e47d17959650 100644 (file)
@@ -4865,6 +4865,18 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
                        tasklet_wakeup(h2s->h2c->wait_event.task);
 
        }
+       /* If we're waiting for flow control, and we got a shutr on the
+        * connection, we will never be unlocked, so add an error on
+        * the conn_stream.
+        */
+       if (conn_xprt_read0_pending(h2s->h2c->conn) &&
+           !b_data(&h2s->h2c->dbuf) &&
+           (h2s->flags & (H2_SF_BLK_SFCTL | H2_SF_BLK_MFCTL))) {
+               if (cs->flags & CS_FL_EOS)
+                       cs->flags |= CS_FL_ERROR;
+               else
+                       cs->flags |= CS_FL_ERR_PENDING;
+       }
        return total;
 }