]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: use conn_sock_shutw() to shutdown a connection
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2015 21:44:53 +0000 (22:44 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2015 21:44:53 +0000 (22:44 +0100)
Stop calling shutdown() on the connection's fd. Note, this also seems
to fix a bug which was harmless, but which consisted in not marking
the connection as shutdown at the socket level until the other side
was shut as well.

src/stream_interface.c

index 7f9eeececf33a0a0ee9506374822a61730a512f5..f2a5332c4d179c7b03cf3b56b478c0b8dd104ae7 100644 (file)
@@ -903,8 +903,7 @@ static void stream_int_shutw_conn(struct stream_interface *si)
                         */
                        if (!(si->flags & SI_FL_NOHALF) || !(ic->flags & (CF_SHUTR|CF_DONT_READ))) {
                                /* We shutdown transport layer */
-                               if (conn_ctrl_ready(conn))
-                                       shutdown(conn->t.sock.fd, SHUT_WR);
+                               conn_sock_shutw(conn);
 
                                if (!(ic->flags & (CF_SHUTR|CF_DONT_READ))) {
                                        /* OK just a shutw, but we want the caller