]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: Make sure we're not in the send list on flow control.
authorOlivier Houchard <ohouchard@haproxy.com>
Wed, 10 Oct 2018 16:51:00 +0000 (18:51 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Oct 2018 13:35:05 +0000 (15:35 +0200)
If we can't send data for a stream because of its flow control, make sure
not to put it in the send_list, until the flow control lets it send again.

This is specific to 1.9, and should not be backported.

src/mux_h2.c

index 568168f532b14d67c6acb6de9a4828b0c4676eff..fee3d536dff0619c9ca1fffe17203ba259f82cce 100644 (file)
@@ -1473,7 +1473,9 @@ static int h2c_handle_window_update(struct h2c *h2c, struct h2s *h2s)
                h2s->mws += inc;
                if (h2s->mws > 0 && (h2s->flags & H2_SF_BLK_SFCTL)) {
                        h2s->flags &= ~H2_SF_BLK_SFCTL;
-                       /* The task will be waken up later */
+                       if (h2s->send_wait)
+                               LIST_ADDQ(&h2c->send_list, &h2s->list);
+
                }
        }
        else {
@@ -3393,6 +3395,10 @@ static size_t h2s_frt_make_resp_data(struct h2s *h2s, const struct buffer *buf,
 
        if (size <= 0) {
                h2s->flags |= H2_SF_BLK_SFCTL;
+               if (h2s->send_wait) {
+                       LIST_DEL(&h2s->list);
+                       LIST_INIT(&h2s->list);
+               }
                goto end;
        }