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
b532d134
Commit
b532d134
authored
Mar 13, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exercise the VSC's created from VMODs
parent
f3468275
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
m00000.vtc
bin/varnishtest/tests/m00000.vtc
+6
-0
VSC_debug.vsc
lib/libvmod_debug/VSC_debug.vsc
+1
-1
vmod.vcc
lib/libvmod_debug/vmod.vcc
+4
-0
vmod_debug.c
lib/libvmod_debug/vmod_debug.c
+8
-0
No files found.
bin/varnishtest/tests/m00000.vtc
View file @
b532d134
...
...
@@ -13,10 +13,12 @@ varnish v1 -vcl+backend {
sub vcl_init {
new objx = debug.obj();
debug.vsc_new();
}
sub vcl_recv {
debug.rot52(req);
debug.vsc_count();
}
sub vcl_deliver {
...
...
@@ -36,6 +38,8 @@ varnish v1 -vcl+backend {
}
} -start
varnish v1 -expect DEBUG.count == 0
client c1 {
txreq -url "/bar"
rxresp
...
...
@@ -50,6 +54,8 @@ client c1 {
expect resp.http.not == -1
} -run
varnish v1 -expect DEBUG.count == 1
logexpect l1 -v v1 -g raw -d 1 {
expect * 1001 VCL_call {^DELIVER}
expect 0 = RespUnset {^foo: bAr}
...
...
lib/libvmod_debug/VSC_debug.vsc
View file @
b532d134
...
...
@@ -5,7 +5,7 @@
Test counters from vmod_debug
.. varnish_vsc::
foo
.. varnish_vsc::
count
:type: counter
:level: debug
:oneliner: arbitrary counter
...
...
lib/libvmod_debug/vmod.vcc
View file @
b532d134
...
...
@@ -170,6 +170,10 @@ $Function VOID vsc_new()
Add a vsc
$Function VOID vsc_count(INT val = 1)
Update counter
$Function VOID vsc_destroy()
Remove a vsc
lib/libvmod_debug/vmod_debug.c
View file @
b532d134
...
...
@@ -370,6 +370,14 @@ xyzzy_vsc_new(VRT_CTX)
AZ
(
pthread_mutex_unlock
(
&
vsc_mtx
));
}
VCL_VOID
xyzzy_vsc_count
(
VRT_CTX
,
VCL_INT
cnt
)
{
(
void
)
ctx
;
AN
(
vsc
);
vsc
->
count
+=
cnt
;
}
VCL_VOID
xyzzy_vsc_destroy
(
VRT_CTX
)
{
...
...
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