]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: connection: make conn_sock_shutw() aware of lingering
authorWilly Tarreau <w@1wt.eu>
Thu, 5 Oct 2017 15:24:42 +0000 (17:24 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:03:24 +0000 (18:03 +0100)
Instead of having to manually handle lingering outside, let's make
conn_sock_shutw() check for it before calling shutdown(). We simply
don't want to emit the FIN if we're going to reset the connection
due to lingering. It's particularly important for silent-drop where
it's absolutely mandatory that no packet leaves the machine.

src/stream_interface.c

index 42656ca165a837fe72f85591af58b312fb3a8b27..9353d08ebfa611ebfe22901ac54f0021d351b72c 100644 (file)
@@ -890,6 +890,7 @@ static void stream_int_shutw_conn(struct stream_interface *si)
                         * layer to try to signal it to the peer before we close.
                         */
                        cs_shutw(cs, CS_SHW_NORMAL);
+                       conn_sock_shutw(conn);
 
                        /* If the stream interface is configured to disable half-open
                         * connections, we'll skip the shutdown(), but only if the