[master] 0bff7aab7 set the cli_limit when the parameter is actually available

Nils Goroll nils.goroll at uplex.de
Mon Dec 16 14:09:07 UTC 2019


commit 0bff7aab71d0e2710cecacde1f0f10a99bfe7e80
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Dec 16 14:49:54 2019 +0100

    set the cli_limit when the parameter is actually available
    
    it is not before we have parsed parameters

diff --git a/bin/varnishd/mgt/mgt_cli.c b/bin/varnishd/mgt/mgt_cli.c
index f40f35b3f..04a27af95 100644
--- a/bin/varnishd/mgt/mgt_cli.c
+++ b/bin/varnishd/mgt/mgt_cli.c
@@ -352,7 +352,6 @@ mgt_cli_init_cls(void)
 
 	mgt_cls = VCLS_New(NULL);
 	AN(mgt_cls);
-	VCLS_SetLimit(mgt_cls, &mgt_param.cli_limit);
 	VCLS_SetHooks(mgt_cls, mgt_cli_cb_before, mgt_cli_cb_after);
 	VCLS_AddFunc(mgt_cls, MCF_NOAUTH, cli_auth);
 	VCLS_AddFunc(mgt_cls, MCF_AUTH, cli_proto);
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index d05a02722..1f920a100 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -704,6 +704,8 @@ main(int argc, char * const *argv)
 		    VSB_data(cli[0].sb));
 	}
 
+	VCLS_SetLimit(mgt_cls, &mgt_param.cli_limit);
+
 	assert(d_flag == 0 || F_flag == 0);
 
 	if (C_flag) {


More information about the varnish-commit mailing list