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
962fe5ac
Commit
962fe5ac
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.syslog() work from vcl_{init,fini}
Related to #1924.
parent
8f465d36
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
r01924.vtc
bin/varnishtest/tests/r01924.vtc
+3
-1
configure.ac
configure.ac
+1
-0
vmod_std.c
lib/libvmod_std/vmod_std.c
+9
-6
No files found.
bin/varnishtest/tests/r01924.vtc
View file @
962fe5ac
varnishtest "Test std.
log
from vcl_{init,fini}"
varnishtest "Test std.
{log,syslog}
from vcl_{init,fini}"
server s1 {
rxreq
...
...
@@ -10,10 +10,12 @@ varnish v1 -vcl+backend {
sub vcl_init {
std.log("init");
std.syslog(8 + 7, "init");
}
sub vcl_fini {
std.log("fini");
std.syslog(8 + 7, "fini");
}
} -start
...
...
configure.ac
View file @
962fe5ac
...
...
@@ -243,6 +243,7 @@ AC_CHECK_FUNCS([nanosleep])
AC_CHECK_FUNCS([setppriv])
AC_CHECK_FUNCS([fallocate])
AC_CHECK_FUNCS([closefrom])
AC_CHECK_FUNCS([vsyslog])
save_LIBS="${LIBS}"
LIBS="${PTHREAD_LIBS}"
...
...
lib/libvmod_std/vmod_std.c
View file @
962fe5ac
...
...
@@ -163,14 +163,17 @@ vmod_syslog(VRT_CTX, VCL_INT fac, const char *fmt, ...)
txt
t
;
CHECK_OBJ_NOTNULL
(
ctx
,
VRT_CTX_MAGIC
);
va_start
(
ap
,
fmt
);
if
(
ctx
->
ws
!=
NULL
)
{
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
);
va_end
(
ap
);
if
(
t
.
e
!=
NULL
)
syslog
((
int
)
fac
,
"%s"
,
t
.
b
);
WS_Release
(
ctx
->
ws
,
0
);
}
else
vsyslog
((
int
)
fac
,
fmt
,
ap
);
va_end
(
ap
);
}
VCL_VOID
__match_proto__
(
td_std_collect
)
...
...
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