]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: connection: make conn_sock_shutw() actually perform the shutdown() call
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2015 21:42:29 +0000 (22:42 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2015 21:42:29 +0000 (22:42 +0100)
This function was not used yet and was only supposed to mark the connection
as shutdown for write. Unfortunately at other places in stream_interface.c,
we're seeing a bit of layering violations with attempts to perform the shutdown
on the fd directly. Let's make this function call shutdown() itself so that
the callers only have to care about the connection.

include/proto/connection.h

index 76093a51b5e4278f890f4426111793e2e81b9403..fc97f1c333de2cef42299321809d31d20a5d317d 100644 (file)
@@ -412,6 +412,8 @@ static inline void conn_sock_shutw(struct connection *c)
 {
        c->flags |= CO_FL_SOCK_WR_SH;
        __conn_sock_stop_send(c);
+       if (conn_ctrl_ready(c))
+               shutdown(c->t.sock.fd, SHUT_WR);
 }
 
 static inline void conn_data_shutw(struct connection *c)