]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: can't connect to the target CLI
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 6 Nov 2018 16:37:11 +0000 (17:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 6 Nov 2018 17:28:33 +0000 (18:28 +0100)
Return an error and quit if the CLI proxy is not able to connect to a
target.

src/cli.c

index 999e4c09aa67680225961c5f1be052e9cfb675f5..32eaf4688c89f5f09f5c06caf189de499152eeae 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1926,6 +1926,11 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
        struct proxy *fe = strm_fe(s);
        struct proxy *be = s->be;
 
+       if (rep->flags & CF_READ_ERROR) {
+               pcli_reply_and_close(s, "Can't connect to the target CLI!\n");
+               s->res.analysers &= ~AN_RES_WAIT_CLI;
+               return 0;
+       }
        rep->flags |= CF_READ_DONTWAIT; /* try to get back here ASAP */
        rep->flags |= CF_NEVER_WAIT;