From: Christopher Faulet Date: Tue, 21 Apr 2020 11:02:14 +0000 (+0200) Subject: BUG/MEDIUM: checks: Be sure to subscribe for sends if outgoing data remains X-Git-Tag: v2.2-dev7~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=815516d6fd334d265208c442afcb21baa02e9405;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: checks: Be sure to subscribe for sends if outgoing data remains 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. --- diff --git a/src/checks.c b/src/checks.c index 6f707fbd02..0ea389e8a1 100644 --- a/src/checks.c +++ b/src/checks.c @@ -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);