]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mux-h1: Wake busy mux for I/O when message is fully sent
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Jun 2019 14:54:15 +0000 (16:54 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Jun 2019 15:40:10 +0000 (17:40 +0200)
If a mux is in busy mode when the outgoing EOM is consummed, it is important to
wake it up for I/O. Because in busy mode, the mux is not subscribed for
receive. Otherwise, it depends on the applicative layer to shutdown the H1
stream. Wake it up allows the mux to catch the read0 as soon as possible.

This patch must be backported to 1.9.

src/mux_h1.c

index 0273f881f52047c71c7c31bf93ea6f798d973393..317f1a55c5d0459de477f111b93996ea2b60c8e7 100644 (file)
@@ -1733,6 +1733,10 @@ static size_t h1_process_output(struct h1c *h1c, struct buffer *buf, size_t coun
                                        goto error;
                          done:
                                h1m->state = H1_MSG_DONE;
+                               if (h1s->h1c->flags & H1C_F_IN_BUSY) {
+                                       h1s->h1c->flags &= ~H1C_F_IN_BUSY;
+                                       tasklet_wakeup(h1s->h1c->wait_event.tasklet);
+                               }
                                break;
 
                        default: