From: Willy Tarreau Date: Tue, 7 Nov 2017 14:07:25 +0000 (+0100) Subject: BUG/MINOR: stream-int: don't set MSG_MORE on closed request path X-Git-Tag: v1.8-rc3~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ecd2e15919f31df2c0e42b3a1ac74f1344d9a2ae;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/stream_interface.c b/src/stream_interface.c index 2c48b031b6..9eef3a2f08 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)