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
a4f7faec
Commit
a4f7faec
authored
Aug 30, 2018
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test that vmod code is still present when calling a task_priv .fini
Tests
20ab2abc
parent
20ab2abc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
r02451.vtc
bin/varnishtest/tests/r02451.vtc
+2
-2
v00041.vtc
bin/varnishtest/tests/v00041.vtc
+10
-0
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+17
-2
No files found.
bin/varnishtest/tests/r02451.vtc
View file @
a4f7faec
...
...
@@ -44,8 +44,8 @@ varnish v1 -vcl+backend {
logexpect l1 -v v1 -g raw -d 1 {
expect 0 0 CLI {^Rd vcl.load}
expect
0
= VCL_Log {^func something to remember}
expect
0
= VCL_Log {^obj something to remember}
expect
4
= VCL_Log {^func something to remember}
expect
2
= VCL_Log {^obj something to remember}
} -start
client c1 {
...
...
bin/varnishtest/tests/v00041.vtc
View file @
a4f7faec
...
...
@@ -61,7 +61,11 @@ varnish v1 -arg "-p debug=+vclrel" -vcl+backend {
logexpect l1 -v v1 -g raw -d 1 {
expect 0 0 CLI {^Rd vcl.load}
expect 0 = Debug {^test_priv_task.*new.$}
expect 0 = Debug {^test_priv_task.*update.$}
expect 0 = Debug {^test_priv_task.*exists.$}
expect 0 = VCL_Log {^func something to remember}
expect 0 = Debug {^test_priv_task.*exists.$}
expect 0 = VCL_Log {^obj something to remember}
expect * 1002 Begin fetch$
...
...
@@ -77,8 +81,14 @@ logexpect l1 -v v1 -g raw -d 1 {
expect 0 = VCL_Log ^bar
expect * 0 Debug {^vcl1: VCL_EVENT_COLD}
expect * 0 CLI {^Rd vcl.discard}
expect 0 = Debug {^test_priv_task.*new.$}
expect 0 = Debug {^test_priv_task.*update.$}
expect 0 = Debug {^test_priv_task.*exists.$}
expect * = VCL_Log {^func cleaning up}
expect 0 = Debug {^test_priv_task.*exists.$}
expect 0 = VCL_Log {^obj cleaning up}
expect 0 = Debug {^priv_task_free}
} -start
client c1 {
...
...
lib/libvmod_debug/vmod_debug.c
View file @
a4f7faec
...
...
@@ -123,16 +123,27 @@ xyzzy_test_priv_call(VRT_CTX, struct vmod_priv *priv)
}
}
static
void
priv_task_free
(
void
*
ptr
)
{
AN
(
ptr
);
VSL
(
SLT_Debug
,
0
,
"priv_task_free(%p)"
,
ptr
);
free
(
ptr
);
}
VCL_STRING
v_matchproto_
(
td_debug_test_priv_task
)
xyzzy_test_priv_task
(
VRT_CTX
,
struct
vmod_priv
*
priv
,
VCL_STRING
s
)
{
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
if
(
s
==
NULL
||
*
s
==
'\0'
)
{
return
priv
->
priv
;
VSL
(
SLT_Debug
,
0
,
"test_priv_task(%p) = %p (exists)"
,
priv
,
priv
->
priv
);
}
else
if
(
priv
->
priv
==
NULL
)
{
priv
->
priv
=
strdup
(
s
);
priv
->
free
=
free
;
priv
->
free
=
priv_task_free
;
VSL
(
SLT_Debug
,
0
,
"test_priv_task(%p) = %p (new)"
,
priv
,
priv
->
priv
);
}
else
{
char
*
n
=
realloc
(
priv
->
priv
,
strlen
(
priv
->
priv
)
+
strlen
(
s
)
+
2
);
...
...
@@ -141,7 +152,11 @@ xyzzy_test_priv_task(VRT_CTX, struct vmod_priv *priv, VCL_STRING s)
strcat
(
n
,
" "
);
strcat
(
n
,
s
);
priv
->
priv
=
n
;
VSL
(
SLT_Debug
,
0
,
"test_priv_task(%p) = %p (update)"
,
priv
,
priv
->
priv
);
}
if
(
priv
->
priv
!=
NULL
)
assert
(
priv
->
free
==
priv_task_free
);
return
(
priv
->
priv
);
}
...
...
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