]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: checks: Be sure to subscribe for sends if outgoing data remains
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Apr 2020 11:02:14 +0000 (13:02 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 08:46:28 +0000 (10:46 +0200)
When some data are scheduled to be sent, we must be sure to subscribe for sends
if nothing was sent. Because of a bug, when nothing was sent, connection errors
are checks. If no error is found, we exit, waiting for more data, without any
subcription on send events.

No need to backport.

src/checks.c

index 6f707fbd025f621ba99d42d21d790f9fee85585f..0ea389e8a1e4c2c4d794c9e8e6afc91006b5f557 100644 (file)
@@ -1983,10 +1983,10 @@ static enum tcpcheck_eval_ret tcpcheck_eval_send(struct check *check, struct tcp
        };
 
        if (conn->mux->snd_buf(cs, &check->bo, b_data(&check->bo), 0) <= 0) {
-               ret = TCPCHK_EVAL_WAIT;
-               if ((conn->flags & CO_FL_ERROR) || (cs->flags & CS_FL_ERROR))
+               if ((conn->flags & CO_FL_ERROR) || (cs->flags & CS_FL_ERROR)) {
                        ret = TCPCHK_EVAL_STOP;
-               goto out;
+                       goto out;
+               }
        }
        if (b_data(&check->bo)) {
                cs->conn->mux->subscribe(cs, SUB_RETRY_SEND, &check->wait_list);
@@ -2388,7 +2388,6 @@ static int tcpcheck_main(struct check *check)
                        if (ret <= 0) {
                                if ((conn && conn->flags & CO_FL_ERROR) || (cs && cs->flags & CS_FL_ERROR))
                                        goto out_end_tcpcheck;
-                               goto out;
                        }
                        if (b_data(&check->bo)) {
                                cs->conn->mux->subscribe(cs, SUB_RETRY_SEND, &check->wait_list);