From: Willy Tarreau Date: Tue, 29 Sep 2015 16:15:01 +0000 (+0200) Subject: CLEANUP: tcp: silent-drop: only drain the connection when quick-ack is disabled X-Git-Tag: v1.6-dev7~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fc2a2d97d6855e9a00a22bc26623e4f2f2c1aeda;p=thirdparty%2Fhaproxy.git CLEANUP: tcp: silent-drop: only drain the connection when quick-ack is disabled The conn_sock_drain() call is only there to force the system to ACK pending data in case of TCP_QUICKACK so that the client doesn't retransmit, otherwise it leads to a real RST making the feature useless. There's no point in draining the connection when quick ack cannot be disabled, so let's move the call inside the ifdef part. --- diff --git a/src/proto_tcp.c b/src/proto_tcp.c index 4c5005e0d3..0655b0dff6 100644 --- a/src/proto_tcp.c +++ b/src/proto_tcp.c @@ -1431,8 +1431,10 @@ static enum act_return tcp_exec_action_silent_drop(struct act_rule *rule, struct if (!conn_ctrl_ready(conn)) goto out; - conn_sock_drain(conn); #ifdef TCP_QUICKACK + /* drain is needed only to send the quick ACK */ + conn_sock_drain(conn); + /* re-enable quickack if it was disabled to ack all data and avoid * retransmits from the client that might trigger a real reset. */