]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Try to wakeup the stream on output buffer allocation
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Oct 2019 08:22:47 +0000 (10:22 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 4 Oct 2019 14:12:02 +0000 (16:12 +0200)
When the output buffer allocation failed, we block stream processing. When
finally a buffer is available and we succed to allocate the output buffer, it
seems fair to wake up the stream.

src/mux_h1.c

index 60461a819aeab20ea6d5936b56ed570ccaa32715..6bf6d3c95d4c534fcf975ce94ead267acf21521f 100644 (file)
@@ -251,6 +251,8 @@ static int h1_process(struct h1c *h1c);
 static struct task *h1_io_cb(struct task *t, void *ctx, unsigned short state);
 static void h1_shutw_conn(struct connection *conn, enum cs_shw_mode mode);
 static struct task *h1_timeout_task(struct task *t, void *context, unsigned short state);
+static void h1_wake_stream_for_recv(struct h1s *h1s);
+static void h1_wake_stream_for_send(struct h1s *h1s);
 
 /* the H1 traces always expect that arg1, if non-null, is of type connection
  * (from which we can derive h1c), that arg2, if non-null, is of type h1s, and
@@ -402,6 +404,8 @@ static int h1_buf_available(void *target)
                TRACE_STATE("unblocking h1s, obuf allocated", H1_EV_TX_DATA|H1_EV_H1S_BLK|H1_EV_STRM_WAKE, h1c->conn, h1c->h1s);
                h1c->flags &= ~H1C_F_OUT_ALLOC;
                tasklet_wakeup(h1c->wait_event.tasklet);
+               if (h1c->h1s)
+                       h1_wake_stream_for_send(h1c->h1s);
                return 1;
        }