Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
b23dddd3
Commit
b23dddd3
authored
Jan 15, 2019
by
Guillaume Quintard
Committed by
guillaume quintard
Jan 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add param.reset command to varnishadm
parent
d8ae26b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
0 deletions
+29
-0
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+13
-0
b00008.vtc
bin/varnishtest/tests/b00008.vtc
+6
-0
changes.rst
doc/changes.rst
+2
-0
cli_cmds.h
include/tbl/cli_cmds.h
+8
-0
No files found.
bin/varnishd/mgt/mgt_param.c
View file @
b23dddd3
...
@@ -505,6 +505,8 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val)
...
@@ -505,6 +505,8 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val)
VCLI_Out
(
cli
,
"parameter
\"
%s
\"
is protected."
,
param
);
VCLI_Out
(
cli
,
"parameter
\"
%s
\"
is protected."
,
param
);
return
;
return
;
}
}
if
(
!
val
)
val
=
pp
->
def
;
if
(
pp
->
func
(
cli
->
sb
,
pp
,
val
))
if
(
pp
->
func
(
cli
->
sb
,
pp
,
val
))
VCLI_SetResult
(
cli
,
CLIS_PARAM
);
VCLI_SetResult
(
cli
,
CLIS_PARAM
);
...
@@ -534,6 +536,16 @@ mcf_param_set(struct cli *cli, const char * const *av, void *priv)
...
@@ -534,6 +536,16 @@ mcf_param_set(struct cli *cli, const char * const *av, void *priv)
MCF_ParamSet
(
cli
,
av
[
2
],
av
[
3
]);
MCF_ParamSet
(
cli
,
av
[
2
],
av
[
3
]);
}
}
/*--------------------------------------------------------------------*/
static
void
v_matchproto_
(
cli_func_t
)
mcf_param_reset
(
struct
cli
*
cli
,
const
char
*
const
*
av
,
void
*
priv
)
{
(
void
)
priv
;
MCF_ParamSet
(
cli
,
av
[
2
],
NULL
);
}
/*--------------------------------------------------------------------
/*--------------------------------------------------------------------
* Add a group of parameters to the global set and sort by name.
* Add a group of parameters to the global set and sort by name.
*/
*/
...
@@ -595,6 +607,7 @@ static struct cli_proto cli_params[] = {
...
@@ -595,6 +607,7 @@ static struct cli_proto cli_params[] = {
{
CLICMD_PARAM_SHOW
,
""
,
mcf_param_show
,
{
CLICMD_PARAM_SHOW
,
""
,
mcf_param_show
,
mcf_param_show_json
},
mcf_param_show_json
},
{
CLICMD_PARAM_SET
,
""
,
mcf_param_set
},
{
CLICMD_PARAM_SET
,
""
,
mcf_param_set
},
{
CLICMD_PARAM_RESET
,
""
,
mcf_param_reset
},
{
NULL
}
{
NULL
}
};
};
...
...
bin/varnishtest/tests/b00008.vtc
View file @
b23dddd3
...
@@ -38,6 +38,12 @@ varnish v1 -clijson "ping -j"
...
@@ -38,6 +38,12 @@ varnish v1 -clijson "ping -j"
varnish v1 -clierr 106 "param.set waiter HASH(0x8839c4c)"
varnish v1 -clierr 106 "param.set waiter HASH(0x8839c4c)"
varnish v1 -cliexpect 60 "param.show first_byte_timeout"
varnish v1 -cliok "param.set first_byte_timeout 120"
varnish v1 -cliexpect 120 "param.show first_byte_timeout"
varnish v1 -cliok "param.reset first_byte_timeout"
varnish v1 -cliexpect 60 "param.show first_byte_timeout"
varnish v1 -cliok "param.set cli_limit 128"
varnish v1 -cliok "param.set cli_limit 128"
varnish v1 -clierr 201 "param.show"
varnish v1 -clierr 201 "param.show"
doc/changes.rst
View file @
b23dddd3
...
@@ -110,6 +110,8 @@ Varnish Cache trunk (ongoing)
...
@@ -110,6 +110,8 @@ Varnish Cache trunk (ongoing)
* added ``req.is_hitmiss`` and ``req.is_hitpass`` (2743_)
* added ``req.is_hitmiss`` and ``req.is_hitpass`` (2743_)
* Add ``param.reset`` command to ``varnishadm``
.. _2809: https://github.com/varnishcache/varnish-cache/issues/2809
.. _2809: https://github.com/varnishcache/varnish-cache/issues/2809
.. _2820: https://github.com/varnishcache/varnish-cache/issues/2820
.. _2820: https://github.com/varnishcache/varnish-cache/issues/2820
.. _2815: https://github.com/varnishcache/varnish-cache/issues/2815
.. _2815: https://github.com/varnishcache/varnish-cache/issues/2815
...
...
include/tbl/cli_cmds.h
View file @
b23dddd3
...
@@ -133,6 +133,14 @@ CLI_CMD(VCL_LABEL,
...
@@ -133,6 +133,14 @@ CLI_CMD(VCL_LABEL,
2
,
2
2
,
2
)
)
CLI_CMD
(
PARAM_RESET
,
"param.reset"
,
"param.reset <param>"
,
"Reset parameter to default value."
,
""
,
1
,
1
)
CLI_CMD
(
PARAM_SHOW
,
CLI_CMD
(
PARAM_SHOW
,
"param.show"
,
"param.show"
,
"param.show [-l|-j] [<param>|changed]"
,
"param.show [-l|-j] [<param>|changed]"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment