]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: h1: Don't try to subscribe if we managed to read data.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 26 Jul 2019 13:11:11 +0000 (15:11 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 26 Jul 2019 15:13:17 +0000 (17:13 +0200)
In h1_recv(), don't subscribe if we managed to receive data. We may not have
to, if we received a complete request, and a new receive will be attempted
later, as the tasklet is woken up either by h1_rcv_buf() or by h1_detach.

src/mux_h1.c

index f4243a2252884048c5d00e11302f915cc2959815..854099de3ddc7039eed5e87f7b674b60a69bece6 100644 (file)
@@ -1945,7 +1945,7 @@ static int h1_recv(struct h1c *h1c)
                }
        }
 
-       if (!h1_recv_allowed(h1c) || !buf_room_for_htx_data(&h1c->ibuf)) {
+       if (ret > 0 || !h1_recv_allowed(h1c) || !buf_room_for_htx_data(&h1c->ibuf)) {
                rcvd = 1;
                goto end;
        }