]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Properly report when mux is blocked during a nego
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Feb 2024 13:46:56 +0000 (14:46 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 28 Feb 2024 14:31:07 +0000 (15:31 +0100)
During a zero-copy forwarding negociation, if the H1 mux is blocked for any
reason, the IOBUF_FL_FF_BLOCKED flag must be set on its iobuf to notfiy the
producer it must wait. However, there were two places where it was not
performed: when the output buffer allocation failed and when the chunk
formatting failed.

This patch fixes the issue. It must be backported to 2.9.

src/mux_h1.c

index aa224d34f74232b76673ab3c2013dda567bf4d5a..18abebc24b9901f52145910a64a4ae83132743fa 100644 (file)
@@ -4487,8 +4487,10 @@ static size_t h1_nego_ff(struct stconn *sc, struct buffer *input, size_t count,
                else {
                        BUG_ON(h1m->state != H1_MSG_CHUNK_CRLF && h1m->state != H1_MSG_CHUNK_SIZE);
                        if (flags & NEGO_FF_FL_EXACT_SIZE) {
-                               if (!h1_make_chunk(h1s, h1m, count))
+                               if (!h1_make_chunk(h1s, h1m, count)) {
+                                       h1s->sd->iobuf.flags |= IOBUF_FL_FF_BLOCKED;
                                        goto out;
+                               }
                                h1m->curr_len = count;
                        }
                        else {
@@ -4531,6 +4533,7 @@ static size_t h1_nego_ff(struct stconn *sc, struct buffer *input, size_t count,
   no_splicing:
        if (!h1_get_buf(h1c, &h1c->obuf)) {
                h1c->flags |= H1C_F_OUT_ALLOC;
+               h1s->sd->iobuf.flags |= IOBUF_FL_FF_BLOCKED;
                TRACE_STATE("waiting for opposite h1c obuf allocation", H1_EV_STRM_SEND|H1_EV_H1S_BLK, h1c->conn, h1s);
                goto out;
        }