From 89f2626c19eac0c27f539039fd950b5b8f2ec7ee Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 1 Jun 2022 17:17:24 +0200 Subject: [PATCH] MEDIUM: httpclient: Don't close CLI applet at the end of a response There is no reason to close the CLI applet when the whole response was dumped. This prevent anyone to use the CLI in interactive mode. --- src/http_client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/http_client.c b/src/http_client.c index 677161beb5..a195832431 100644 --- a/src/http_client.c +++ b/src/http_client.c @@ -235,15 +235,16 @@ static int hc_cli_io_handler(struct appctx *appctx) /* we must close only if F_END is the last flag */ if (ctx->flags == HC_CLI_F_RES_END) { - sc_shutw(sc); - sc_shutr(sc); ctx->flags &= ~HC_CLI_F_RES_END; + goto end; } more: if (!ctx->flags) applet_have_no_more_data(appctx); return 0; +end: + return 1; too_many_hdrs: return cli_err(appctx, "Too many headers.\n"); -- 2.47.3