]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
OPTIM: stream-int: try to send pending spliced data
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Dec 2014 18:56:47 +0000 (19:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 24 Dec 2014 22:47:33 +0000 (23:47 +0100)
This is the equivalent of eb9fd51 ("OPTIM: stream_sock: reduce the amount
of in-flight spliced data") whose purpose is to try to immediately send
spliced data if available.

src/stream_interface.c

index 781f449343670a255c7ff2595b5d4ae4ad95d4cd..bafb0d2c03d6f79234b2a8cddf9923c8e57c932b 100644 (file)
@@ -180,7 +180,8 @@ static void stream_int_update_embedded(struct stream_interface *si)
                si_chk_rcv(si->ob->prod);
 
        if (((si->ib->flags & CF_READ_PARTIAL) && !channel_is_empty(si->ib)) &&
-           (si->ib->cons->flags & SI_FL_WAIT_DATA)) {
+           (si->ib->pipe /* always try to send spliced data */ ||
+            (si->ib->buf->i == 0 && (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) && !si->ib->pipe)