From 3ac41d2a8ec79b519e27d40c86783b9b4b7a1140 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 9 Dec 2014 19:56:47 +0100 Subject: OPTIM: stream-int: try to send pending spliced data 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. BTW the equivalent of this change after buffer modifications has become incorrect as it checks that the input is empty instead of checking that the output is a full buffer as was the original intent. --- src/stream_interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 5e8a8fb..1fd7bff 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -180,7 +180,7 @@ 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 || (si->ib->buf->o == si->ib->buf->size && (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) -- 1.7.12.1