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
2b013025
Commit
2b013025
authored
Jan 10, 2017
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load the vcls and labels into the child process in dependency order.
parent
19ff7a59
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
34 deletions
+38
-34
mgt_vcl.c
bin/varnishd/mgt/mgt_vcl.c
+35
-33
r02177.vtc
bin/varnishtest/tests/r02177.vtc
+3
-1
No files found.
bin/varnishd/mgt/mgt_vcl.c
View file @
2b013025
...
...
@@ -74,6 +74,7 @@ struct vclprog {
VTAILQ_HEAD
(,
vcldep
)
dfrom
;
VTAILQ_HEAD
(,
vcldep
)
dto
;
int
nto
;
int
loaded
;
};
static
VTAILQ_HEAD
(,
vclprog
)
vclhead
=
VTAILQ_HEAD_INITIALIZER
(
vclhead
);
...
...
@@ -409,45 +410,46 @@ mgt_push_vcls_and_start(struct cli *cli, unsigned *status, char **p)
{
struct
vclprog
*
vp
;
struct
vcldep
*
vd
;
int
done
;
AN
(
active_vcl
);
/* The VCL has not been loaded yet, it cannot fail */
AZ
(
mgt_vcl_setstate
(
cli
,
active_vcl
,
VCL_STATE_WARM
));
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
{
if
(
!
VTAILQ_EMPTY
(
&
vp
->
dfrom
))
continue
;
if
(
mcf_is_label
(
vp
))
continue
;
if
(
mgt_cli_askchild
(
status
,
p
,
"vcl.load
\"
%s
\"
%s %d%s
\n
"
,
vp
->
name
,
vp
->
fname
,
vp
->
warm
,
vp
->
state
)
)
return
(
1
)
;
free
(
*
p
);
*
p
=
NULL
;
}
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
{
if
(
!
mcf_is_label
(
vp
))
continue
;
vd
=
VTAILQ_FIRST
(
&
vp
->
dfrom
);
AN
(
vd
);
if
(
mgt_cli_askchild
(
status
,
p
,
"vcl.label %s %s
\n
"
,
vp
->
name
,
vd
->
to
->
name
))
return
(
1
);
free
(
*
p
);
*
p
=
NULL
;
}
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
{
if
(
VTAILQ_EMPTY
(
&
vp
->
dfrom
))
continue
;
if
(
mcf_is_label
(
vp
))
continue
;
if
(
mgt_cli_askchild
(
status
,
p
,
"vcl.load
\"
%s
\"
%s %d%s
\n
"
,
vp
->
name
,
vp
->
fname
,
vp
->
warm
,
vp
->
state
))
return
(
1
);
free
(
*
p
)
;
*
p
=
NULL
;
}
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
vp
->
loaded
=
0
;
do
{
done
=
1
;
VTAILQ_FOREACH
(
vp
,
&
vclhead
,
list
)
{
if
(
vp
->
loaded
)
continue
;
VTAILQ_FOREACH
(
vd
,
&
vp
->
dfrom
,
lfrom
)
if
(
!
vd
->
to
->
loaded
)
break
;
if
(
vd
!=
NULL
)
{
done
=
0
;
continue
;
}
if
(
mcf_is_label
(
vp
))
{
vd
=
VTAILQ_FIRST
(
&
vp
->
dfrom
);
AN
(
vd
);
if
(
mgt_cli_askchild
(
status
,
p
,
"vcl.label %s %s
\n
"
,
vp
->
name
,
vd
->
to
->
name
))
return
(
1
);
}
else
{
if
(
mgt_cli_askchild
(
status
,
p
,
"vcl.load
\"
%s
\"
%s %d%s
\n
"
,
vp
->
name
,
vp
->
fname
,
vp
->
warm
,
vp
->
state
))
return
(
1
)
;
}
vp
->
loaded
=
1
;
free
(
*
p
);
*
p
=
NULL
;
}
}
while
(
!
done
);
if
(
mgt_cli_askchild
(
status
,
p
,
"vcl.use
\"
%s
\"\n
"
,
active_vcl
->
name
))
return
(
1
);
...
...
bin/varnishtest/tests/r02177.vtc
View file @
2b013025
...
...
@@ -12,7 +12,7 @@ server s2 {
varnish v1 -vcl {
backend s1 { .host="${s1_addr}"; .port="${s1_port}"; }
}
-start
}
varnish v1 -cli "vcl.label lbl1 vcl1"
...
...
@@ -43,6 +43,8 @@ varnish v1 -vcl {
}
}
varnish v1 -cliok "vcl.list"
varnish v1 -start
varnish v1 -cliok "vcl.list"
logexpect l1 -v v1 -g raw {
...
...
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