]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream-int: support splicing from applets
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Dec 2014 18:47:54 +0000 (19:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:33 +0000 (23:47 +0100)
If we want to splice from applets, we must check the pipe before clearing
SI_FL_WAIT_ROOM.

src/stream_interface.c

index 08c72e56c676c6cec0c9ab381ddb3a057c23120a..781f449343670a255c7ff2595b5d4ae4ad95d4cd 100644 (file)
@@ -183,7 +183,7 @@ static void stream_int_update_embedded(struct stream_interface *si)
            (si->ib->cons->flags & SI_FL_WAIT_DATA)) {
                si_chk_snd(si->ib->cons);
                /* check if the consumer has freed some space */
-               if (!channel_full(si->ib))
+               if (!channel_full(si->ib) && !si->ib->pipe)
                        si->flags &= ~SI_FL_WAIT_ROOM;
        }
 
@@ -314,7 +314,7 @@ static void stream_int_chk_rcv(struct stream_interface *si)
        if (unlikely(si->state != SI_ST_EST || (ib->flags & (CF_SHUTR|CF_DONT_READ))))
                return;
 
-       if (channel_full(ib)) {
+       if (channel_full(ib) || ib->pipe) {
                /* stop reading */
                si->flags |= SI_FL_WAIT_ROOM;
        }