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
09628c73
Commit
09628c73
authored
Mar 09, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Propagate warm/cold transitions to VCL_EVENTs
parent
f9fbfca6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
cache_vcl.c
bin/varnishd/cache/cache_vcl.c
+15
-1
No files found.
bin/varnishd/cache/cache_vcl.c
View file @
09628c73
...
@@ -172,9 +172,22 @@ vcl_find(const char *name)
...
@@ -172,9 +172,22 @@ vcl_find(const char *name)
static
void
static
void
vcl_set_state
(
struct
vcls
*
vcl
,
const
char
*
state
)
vcl_set_state
(
struct
vcls
*
vcl
,
const
char
*
state
)
{
{
struct
vrt_ctx
ctx
;
int
warm
;
unsigned
hand
=
0
;
vcl
->
warm
=
state
[
0
]
==
'1'
?
1
:
0
;
assert
(
state
[
0
]
==
'0'
||
state
[
0
]
==
'1'
);
warm
=
state
[
0
]
==
'1'
?
1
:
0
;
bprintf
(
vcl
->
state
,
"%s"
,
state
+
1
);
bprintf
(
vcl
->
state
,
"%s"
,
state
+
1
);
if
(
warm
==
vcl
->
warm
)
return
;
vcl
->
warm
=
warm
;
INIT_OBJ
(
&
ctx
,
VRT_CTX_MAGIC
);
ctx
.
handling
=
&
hand
;
(
void
)
vcl
->
conf
->
event_vcl
(
&
ctx
,
vcl
->
warm
?
VCL_EVENT_WARM
:
VCL_EVENT_COLD
);
}
}
static
int
static
int
...
@@ -384,6 +397,7 @@ ccf_config_use(struct cli *cli, const char * const *av, void *priv)
...
@@ -384,6 +397,7 @@ ccf_config_use(struct cli *cli, const char * const *av, void *priv)
AZ
(
priv
);
AZ
(
priv
);
vcl
=
vcl_find
(
av
[
2
]);
vcl
=
vcl_find
(
av
[
2
]);
AN
(
vcl
);
// MGT ensures this
AN
(
vcl
);
// MGT ensures this
AN
(
vcl
->
warm
);
// MGT ensures this
INIT_OBJ
(
&
ctx
,
VRT_CTX_MAGIC
);
INIT_OBJ
(
&
ctx
,
VRT_CTX_MAGIC
);
ctx
.
handling
=
&
hand
;
ctx
.
handling
=
&
hand
;
ctx
.
cli
=
cli
;
ctx
.
cli
=
cli
;
...
...
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