]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: checks: use cs_drain_and_close() instead of draining the connection
authorWilly Tarreau <w@1wt.eu>
Fri, 11 Dec 2020 10:09:29 +0000 (11:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 11 Dec 2020 10:09:29 +0000 (11:09 +0100)
As explained in previous commit, the situation is absurd as we try to
cleanly drain pending data before impolitely shutting down, and it could
be counter productive on real muxes. Let's use cs_drain_and_close() instead.

src/check.c

index edcaf327c820780e52aa8bb24857348513ca619d..c625b904373f273d9c1bb74df595c0f2751acf2f 100644 (file)
@@ -797,8 +797,7 @@ static int wake_srv_chk(struct conn_stream *cs)
                /* Check complete or aborted. If connection not yet closed do it
                 * now and wake the check task up to be sure the result is
                 * handled ASAP. */
-               conn_sock_drain(conn);
-               cs_close(cs);
+               cs_drain_and_close(cs);
                ret = -1;
                /* We may have been scheduled to run, and the
                 * I/O handler expects to have a cs, so remove
@@ -899,8 +898,7 @@ static struct task *process_chk_conn(struct task *t, void *context, unsigned sho
                         * as a failed response coupled with "observe layer7" caused the
                         * server state to be suddenly changed.
                         */
-                       conn_sock_drain(conn);
-                       cs_close(cs);
+                       cs_drain_and_close(cs);
                }
 
                if (cs) {