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
28eec51b
Commit
28eec51b
authored
Dec 05, 2015
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make event handling more readable in vmod-debug
parent
57a5b9c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
15 deletions
+36
-15
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+36
-15
No files found.
lib/libvmod_debug/vmod_debug.c
View file @
28eec51b
...
...
@@ -249,23 +249,10 @@ priv_vcl_free(void *priv)
AZ
(
priv_vcl
);
}
int
__match_proto__
(
vmod_event_f
)
event_
function
(
VRT_CTX
,
struct
vmod_priv
*
priv
,
enum
vcl_event_e
e
)
static
int
event_
load
(
VRT_CTX
,
struct
vmod_priv
*
priv
)
{
struct
priv_vcl
*
priv_vcl
;
const
char
*
ev
;
switch
(
e
)
{
case
VCL_EVENT_COLD
:
ev
=
"VCL_EVENT_COLD"
;
break
;
case
VCL_EVENT_WARM
:
ev
=
"VCL_EVENT_WARM"
;
break
;
default:
ev
=
NULL
;
}
if
(
ev
!=
NULL
)
VSL
(
SLT_Debug
,
0
,
"%s: %s"
,
VCL_Name
(
ctx
->
vcl
),
ev
);
if
(
e
!=
VCL_EVENT_LOAD
)
return
(
0
);
AN
(
ctx
->
msg
);
if
(
cache_param
->
nuke_limit
==
42
)
{
...
...
@@ -282,6 +269,40 @@ event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
return
(
0
);
}
static
int
event_warm
(
VRT_CTX
)
{
VSL
(
SLT_Debug
,
0
,
"%s: VCL_EVENT_WARM"
,
VCL_Name
(
ctx
->
vcl
));
if
(
cache_param
->
max_esi_depth
==
42
)
{
VSB_printf
(
ctx
->
msg
,
"max_esi_depth is not the answer."
);
return
(
-
1
);
}
return
(
0
);
}
static
int
event_cold
(
VRT_CTX
)
{
VSL
(
SLT_Debug
,
0
,
"%s: VCL_EVENT_COLD"
,
VCL_Name
(
ctx
->
vcl
));
return
(
0
);
}
int
__match_proto__
(
vmod_event_f
)
event_function
(
VRT_CTX
,
struct
vmod_priv
*
priv
,
enum
vcl_event_e
e
)
{
switch
(
e
)
{
case
VCL_EVENT_LOAD
:
return
event_load
(
ctx
,
priv
);
case
VCL_EVENT_COLD
:
return
event_cold
(
ctx
);
case
VCL_EVENT_WARM
:
return
event_warm
(
ctx
);
default:
return
(
0
);
}
}
VCL_VOID
__match_proto__
(
td_debug_sleep
)
vmod_sleep
(
VRT_CTX
,
VCL_DURATION
t
)
{
...
...
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