]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mux-h1: Don't set the flag CS_FL_RCV_MORE when nothing was parsed
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 19 Nov 2018 20:54:26 +0000 (21:54 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 20 Nov 2018 13:31:44 +0000 (14:31 +0100)
When we start to parse a new message, if all headers have not been received,
nothing is copied in the channel's buffer. In this situation, we must not set
the flag CS_FL_RCV_MORE on the conn-stream. If we do so, the connection freezes
because there is no data to send that can reenable the reads

src/mux_h1.c

index 6c0afad649090ee14d0cc21d326500e869a9f026..87b58415740ffba9f1eb2e0c28f2cbced1fec35c 100644 (file)
@@ -1112,8 +1112,10 @@ static size_t h1_process_input(struct h1c *h1c, struct buffer *buf, int flags)
                tasklet_wakeup(h1c->wait_event.task);
        }
 
-       if (b_data(&h1c->ibuf))
-               h1s->cs->flags |= CS_FL_RCV_MORE;
+       if (b_data(&h1c->ibuf)) {
+               if (!htx_is_empty(htx))
+                       h1s->cs->flags |= CS_FL_RCV_MORE;
+       }
        else {
                h1_release_buf(h1c, &h1c->ibuf);
                h1_sync_messages(h1c);