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
dbfa7b42
Commit
dbfa7b42
authored
Jun 15, 2016
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Nitpicking around the corners of vcl labels
parent
75f8e5ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
mgt_vcl.c
bin/varnishd/mgt/mgt_vcl.c
+12
-2
v00048.vtc
bin/varnishtest/tests/v00048.vtc
+4
-0
No files found.
bin/varnishd/mgt/mgt_vcl.c
View file @
dbfa7b42
...
...
@@ -437,7 +437,9 @@ mcf_vcl_discard(struct cli *cli, const char * const *av, void *priv)
if
(
vp
->
label
!=
NULL
)
{
AN
(
vp
->
warm
);
VCLI_SetResult
(
cli
,
CLIS_PARAM
);
VCLI_Out
(
cli
,
"Must remove label to discard VCL
\n
"
);
VCLI_Out
(
cli
,
"Cannot discard labeled (
\"
%s
\"
) VCL program.
\n
"
,
vp
->
label
->
name
);
return
;
}
(
void
)
mgt_vcl_setstate
(
cli
,
vp
,
VCL_STATE_COLD
);
...
...
@@ -500,6 +502,12 @@ mcf_vcl_label(struct cli *cli, const char * const *av, void *priv)
VCLI_Out
(
cli
,
"VCL labels cannot point to labels"
);
return
;
}
if
(
vpt
->
label
!=
NULL
)
{
VCLI_SetResult
(
cli
,
CLIS_PARAM
);
VCLI_Out
(
cli
,
"VCL already labeled (
\"
%s
\"
)"
,
vpt
->
label
->
name
);
return
;
}
vpl
=
mgt_vcl_byname
(
av
[
2
]);
if
(
vpl
==
NULL
)
vpl
=
mgt_vcl_add
(
av
[
2
],
NULL
,
VCL_STATE_LABEL
);
...
...
@@ -511,8 +519,10 @@ mcf_vcl_label(struct cli *cli, const char * const *av, void *priv)
}
vpl
->
warm
=
1
;
if
(
vpl
->
label
!=
NULL
)
{
assert
(
vpl
->
label
->
label
==
vpl
);
/* XXX SET vp->label AUTO */
vpl
->
label
->
label
=
NULL
;
/* XXX SET AUTO */
vpl
->
label
=
NULL
;
}
vpl
->
label
=
vpt
;
vpt
->
label
=
vpl
;
...
...
bin/varnishtest/tests/v00048.vtc
View file @
dbfa7b42
...
...
@@ -31,7 +31,11 @@ client c1 {
varnish v1 -cliok "vcl.list"
varnish v1 -clierr 106 "vcl.label foo vcl0"
varnish v1 -cliok "vcl.label foo vcl2"
varnish v1 -clierr 106 "vcl.label bar vcl2"
varnish v1 -clierr 106 "vcl.discard vcl2"
varnish v1 -cliok "vcl.label foo vcl1"
varnish v1 -clierr 106 "vcl.label vcl1 vcl2"
varnish v1 -clierr 106 "vcl.state foo cold"
varnish v1 -clierr 106 "vcl.label bar foo"
varnish v1 -clierr 106 "vcl.discard vcl1"
...
...
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