]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: httpclient: Don't close CLI applet at the end of a response
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jun 2022 15:17:24 +0000 (17:17 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Jun 2022 15:20:57 +0000 (17:20 +0200)
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

index 677161beb51f83b74a2340fdc9868a010bb8c093..a1958324313ec6015531bdc22c7d16cf42a22841 100644 (file)
@@ -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");