]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stream-int: remove a redundant clearing of the linger_risk flag
authorWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2015 21:32:27 +0000 (22:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 12 Mar 2015 21:32:27 +0000 (22:32 +0100)
In stream_sock_read0(), we used to clear this flag. But the only case
where stream_sock_read0() is called is in reaction with a conn_sock_read0()
event coming from the lower layers, which already clears this flag. So let's
remove this duplicate one and clear one of the few remaining layering
violations in this area.

src/stream_interface.c

index 1ba509e75056899800852ff8f4c84789d3e50782..7f9eeececf33a0a0ee9506374822a61730a512f5 100644 (file)
@@ -1343,9 +1343,7 @@ static void si_conn_send_cb(struct connection *conn)
 /*
  * This function propagates a null read received on a socket-based connection.
  * It updates the stream interface. If the stream interface has SI_FL_NOHALF,
- * the close is also forwarded to the write side as an abort. This function is
- * still socket-specific as it handles a setsockopt() call to set the SO_LINGER
- * state on the socket.
+ * the close is also forwarded to the write side as an abort.
  */
 void stream_sock_read0(struct stream_interface *si)
 {
@@ -1375,8 +1373,6 @@ void stream_sock_read0(struct stream_interface *si)
        }
 
        /* otherwise that's just a normal read shutdown */
-       if (conn_ctrl_ready(conn))
-               fdtab[conn->t.sock.fd].linger_risk = 0;
        __conn_data_stop_recv(conn);
        return;