From ecd2e15919f31df2c0e42b3a1ac74f1344d9a2ae Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 7 Nov 2017 15:07:25 +0100 Subject: [PATCH] BUG/MINOR: stream-int: don't set MSG_MORE on closed request path Commit 4ac4928 ("BUG/MINOR: stream-int: don't set MSG_MORE on SHUTW_NOW without AUTO_CLOSE") was incomplete. H2 reveals another situation where the input stream is marked closed with the request and we set MSG_MORE, causing a delay before the request leaves. Better avoid setting the flag on the request path for close cases in general. --- src/stream_interface.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 2c48b031b..9eef3a2f0 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -673,7 +673,8 @@ static void si_cs_send(struct conn_stream *cs) if ((!(oc->flags & (CF_NEVER_WAIT|CF_SEND_DONTWAIT)) && ((oc->to_forward && oc->to_forward != CHN_INFINITE_FORWARD) || (oc->flags & CF_EXPECT_MORE))) || - ((oc->flags & (CF_AUTO_CLOSE|CF_SHUTW_NOW)) == (CF_AUTO_CLOSE|CF_SHUTW_NOW))) + ((oc->flags & CF_ISRESP) && + ((oc->flags & (CF_AUTO_CLOSE|CF_SHUTW_NOW)) == (CF_AUTO_CLOSE|CF_SHUTW_NOW)))) send_flag |= CO_SFL_MSG_MORE; if (oc->flags & CF_STREAMER)