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
8f465d36
Commit
8f465d36
authored
May 16, 2016
by
Federico G. Schwindt
Committed by
Lasse Karstensen
Jun 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make std.log() work from vcl_{init,fini}
Fixes #1924.
parent
8fabd4aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
9 deletions
+34
-9
r01924.vtc
bin/varnishtest/tests/r01924.vtc
+22
-0
vmod_std.c
lib/libvmod_std/vmod_std.c
+12
-9
No files found.
bin/varnishtest/tests/r01924.vtc
0 → 100644
View file @
8f465d36
varnishtest "Test std.log from vcl_{init,fini}"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
import std;
sub vcl_init {
std.log("init");
}
sub vcl_fini {
std.log("fini");
}
} -start
varnish v1 -vcl+backend { }
varnish v1 -cliok "vcl.discard vcl1"
lib/libvmod_std/vmod_std.c
View file @
8f465d36
...
...
@@ -139,17 +139,20 @@ vmod_log(VRT_CTX, const char *fmt, ...)
txt
t
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
u
=
WS_Reserve
(
ctx
->
ws
,
0
);
t
.
b
=
ctx
->
ws
->
f
;
va_start
(
ap
,
fmt
);
t
.
e
=
VRT_StringList
(
ctx
->
ws
->
f
,
u
,
fmt
,
ap
);
if
(
ctx
->
vsl
!=
NULL
)
{
u
=
WS_Reserve
(
ctx
->
ws
,
0
);
t
.
b
=
ctx
->
ws
->
f
;
t
.
e
=
VRT_StringList
(
ctx
->
ws
->
f
,
u
,
fmt
,
ap
);
if
(
t
.
e
!=
NULL
)
{
assert
(
t
.
e
>
t
.
b
);
t
.
e
--
;
VSLbt
(
ctx
->
vsl
,
SLT_VCL_Log
,
t
);
}
WS_Release
(
ctx
->
ws
,
0
);
}
else
VSLv
(
SLT_VCL_Log
,
0
,
fmt
,
ap
);
va_end
(
ap
);
if
(
t
.
e
!=
NULL
)
{
assert
(
t
.
e
>
t
.
b
);
t
.
e
--
;
VSLbt
(
ctx
->
vsl
,
SLT_VCL_Log
,
t
);
}
WS_Release
(
ctx
->
ws
,
0
);
}
VCL_VOID
__match_proto__
(
td_std_syslog
)
...
...
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