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
8fabd4aa
Commit
8fabd4aa
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
Add a VSL variant that takes uses stdarg(3)
parent
b9a817ae
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
cache.h
bin/varnishd/cache/cache.h
+1
-0
cache_shmlog.c
bin/varnishd/cache/cache_shmlog.c
+12
-5
No files found.
bin/varnishd/cache/cache.h
View file @
8fabd4aa
...
...
@@ -957,6 +957,7 @@ void *VSM_Alloc(unsigned size, const char *class, const char *type,
const
char
*
ident
);
void
VSM_Free
(
void
*
ptr
);
#ifdef VSL_ENDMARKER
void
VSLv
(
enum
VSL_tag_e
tag
,
uint32_t
vxid
,
const
char
*
fmt
,
va_list
va
);
void
VSL
(
enum
VSL_tag_e
tag
,
uint32_t
vxid
,
const
char
*
fmt
,
...)
__v_printflike
(
3
,
4
);
void
VSLbv
(
struct
vsl_log
*
,
enum
VSL_tag_e
tag
,
const
char
*
fmt
,
va_list
va
);
...
...
bin/varnishd/cache/cache_shmlog.c
View file @
8fabd4aa
...
...
@@ -207,9 +207,8 @@ vslr(enum VSL_tag_e tag, uint32_t vxid, const char *b, unsigned len)
*/
void
VSL
(
enum
VSL_tag_e
tag
,
uint32_t
vxid
,
const
char
*
fmt
,
...
)
VSL
v
(
enum
VSL_tag_e
tag
,
uint32_t
vxid
,
const
char
*
fmt
,
va_list
ap
)
{
va_list
ap
;
unsigned
n
,
mlen
=
cache_param
->
vsl_reclen
;
char
buf
[
mlen
];
...
...
@@ -217,18 +216,26 @@ VSL(enum VSL_tag_e tag, uint32_t vxid, const char *fmt, ...)
if
(
vsl_tag_is_masked
(
tag
))
return
;
if
(
strchr
(
fmt
,
'%'
)
==
NULL
)
{
vslr
(
tag
,
vxid
,
fmt
,
strlen
(
fmt
)
+
1
);
}
else
{
va_start
(
ap
,
fmt
);
n
=
vsnprintf
(
buf
,
mlen
,
fmt
,
ap
);
va_end
(
ap
);
if
(
n
>
mlen
-
1
)
n
=
mlen
-
1
;
buf
[
n
++
]
=
'\0'
;
/* NUL-terminated */
vslr
(
tag
,
vxid
,
buf
,
n
);
}
}
void
VSL
(
enum
VSL_tag_e
tag
,
uint32_t
vxid
,
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
VSLv
(
tag
,
vxid
,
fmt
,
ap
);
va_end
(
ap
);
}
/*--------------------------------------------------------------------*/
...
...
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