Return an error and quit if the CLI proxy is not able to connect to a target. --- src/cli.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/src/cli.c b/src/cli.c index 999e4c09a..32eaf4688 100644 --- 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; -- 2.16.4