]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream-int: don't set MSG_MORE on closed request path
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 14:07:25 +0000 (15:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 14:07:25 +0000 (15:07 +0100)
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

index 2c48b031b647168e884efae3cc6a2bdfb04f474a..9eef3a2f08cf475c818d20cac86ec51d1b7768c8 100644 (file)
@@ -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)