From 4dfd54f26a8bbef6aeec1df970bd8e1e84263137 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 12 Mar 2015 22:44:53 +0100 Subject: [PATCH] MINOR: stream-int: use conn_sock_shutw() to shutdown a connection 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 7f9eeecec..f2a5332c4 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -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