]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2: don't try to send data before preface
authorWilly Tarreau <w@1wt.eu>
Mon, 8 Oct 2018 07:43:03 +0000 (09:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 12 Oct 2018 14:58:01 +0000 (16:58 +0200)
h2_snd_buf() must not accept to send data if the preface was not yet
received nor sent. At the moment it doesn't happen but it can with
server-side H2.

src/mux_h2.c

index c01a42a299bb3490576eee47731119dccc2079bb..c380dc9afafe495ca78f0ec33843f2fb630c3ce7 100644 (file)
@@ -3615,6 +3615,9 @@ static size_t h2_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
        size_t total = 0;
        size_t ret;
 
+       if (h2s->h2c->st0 < H2_CS_FRAME_H)
+               return 0;
+
        if (!(h2s->flags & H2_SF_OUTGOING_DATA) && count)
                h2s->flags |= H2_SF_OUTGOING_DATA;