Mailing List Archive

[6.0] 6590787f0 for compiling VCLs, truncation is not an error
commit 6590787f0e935161d3e99fb7b68dfbb4e593f976
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Mon Dec 16 14:57:09 2019 +0100

for compiling VCLs, truncation is not an error

Conflicts:
bin/varnishd/mgt/mgt_main.c

diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 2e0ee14f5..765efd39a 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -175,7 +175,10 @@ usage(void)
static void
cli_check(const struct cli *cli)
{
- if (cli->result == CLIS_OK) {
+ if (cli->result == CLIS_OK || cli->result == CLIS_TRUNCATED) {
+ 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;
}
@@ -798,7 +801,9 @@ main(int argc, char * const *argv)
fprintf(stderr, "%s\n", VSB_data(cli->sb));
VSB_clear(cli->sb);
}
- exit(cli->result == CLIS_OK ? 0 : 2);
+ if (cli->result == CLIS_OK || cli->result == CLIS_TRUNCATED)
+ exit(0);
+ exit(2);
} else {
while (!VTAILQ_EMPTY(&f_args)) {
fa = VTAILQ_FIRST(&f_args);
diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c
index c0fadf475..5d7bab1a7 100644
--- a/bin/varnishd/mgt/mgt_vcl.c
+++ b/bin/varnishd/mgt/mgt_vcl.c
@@ -603,7 +603,7 @@ mgt_new_vcl(struct cli *cli, const char *vclname, const char *vclsrc,
if (active_vcl == NULL)
active_vcl = vp;

- if (cli->result == CLIS_OK &&
+ if ((cli->result == CLIS_OK || cli->result == CLIS_TRUNCATED) &&
vcl_count > mgt_param.max_vcl &&
mgt_param.max_vcl_handling == 1) {
VCLI_Out(cli, "%d VCLs loaded\n", vcl_count);
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit