[master] 035a5becc output warnings also for varnishd -f argument
Nils Goroll
nils.goroll at uplex.de
Mon Dec 16 13:11:07 UTC 2019
commit 035a5beccb19fd280b6868c44382cb243a4b317b
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Mon Dec 16 14:06:15 2019 +0100
output warnings also for varnishd -f argument
Fixes #3160
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index b4407db14..d05a02722 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -175,6 +175,9 @@ static void
cli_check(const struct cli *cli)
{
if (cli->result == CLIS_OK) {
+ AZ(VSB_finish(cli->sb));
+ if (VSB_len(cli->sb) > 0)
+ fprintf(stderr, "Warnings:\n%s\n", VSB_data(cli->sb));
VSB_clear(cli->sb);
return;
}
diff --git a/bin/varnishtest/tests/r03159.vtc b/bin/varnishtest/tests/r03159.vtc
index e601e4a04..2a78b99c8 100644
--- a/bin/varnishtest/tests/r03159.vtc
+++ b/bin/varnishtest/tests/r03159.vtc
@@ -1,4 +1,6 @@
-varnishtest "double sub unref warning"
+varnishtest "double sub unref warning / warnings output for -f"
+
+# Also tests #3160
shell {
cat >unref.vcl <<-EOF
@@ -8,6 +10,16 @@ shell {
EOF
}
+shell -match "^1$" {
+ {
+ varnishd -F -n "${tmpdir}/t" -a "${tmpdir}/sock" \
+ -p vcc_err_unref=off -f "${tmpdir}/unref.vcl" &
+ pid=$!
+ varnishadm -n "${tmpdir}/t" stop
+ kill $pid
+ } 2>&1 | grep -c "That was just a warning"
+}
+
varnish v1 -cliok "param.set vcc_err_unref off"
shell -match "^1$" {
More information about the varnish-commit
mailing list