[master] 96bb4f7 Move clearing of cli->vsb up to also cover centralized error checks

Poul-Henning Kamp phk at FreeBSD.org
Mon Oct 10 18:21:04 CEST 2016


commit 96bb4f7f604a141a6812e1d856f4ee05c7b78fee
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Oct 10 16:19:48 2016 +0000

    Move clearing of cli->vsb up to also cover centralized error checks

diff --git a/lib/libvarnish/vcli_serve.c b/lib/libvarnish/vcli_serve.c
index 80d09de..119b5f1 100644
--- a/lib/libvarnish/vcli_serve.c
+++ b/lib/libvarnish/vcli_serve.c
@@ -194,6 +194,8 @@ cls_dispatch(struct cli *cli, const struct cli_proto *cp,
 
 	AN(av);
 
+	VSB_clear(cli->sb);
+
 	if (ac > 1 && !strcmp(av[2], "-j"))
 		json = 1;
 
@@ -221,7 +223,6 @@ cls_dispatch(struct cli *cli, const struct cli_proto *cp,
 	}
 
 	cli->result = CLIS_OK;
-	VSB_clear(cli->sb);
 	if (json)
 		cp->jsonfunc(cli, (const char * const *)av, cp->priv);
 	else



More information about the varnish-commit mailing list