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
24ad8224
Commit
24ad8224
authored
Sep 25, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make synthetic SLT_VSL records NUL-terminated
parent
a1726adc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
vsl_dispatch.c
lib/libvarnishapi/vsl_dispatch.c
+13
-10
No files found.
lib/libvarnishapi/vsl_dispatch.c
View file @
24ad8224
...
...
@@ -758,20 +758,23 @@ static int
vtx_diag
(
struct
VSLQ
*
vslq
,
struct
vtx
*
vtx
,
const
char
*
fmt
,
...)
{
va_list
ap
;
uint32_t
buf
[
256
];
int
i
,
len
;
uint32_t
chunk
[
256
];
char
*
buf
;
int
l
,
buflen
;
struct
VSLC_ptr
rec
;
len
=
sizeof
buf
-
2
*
sizeof
(
uint32_t
);
buf
=
(
char
*
)
&
chunk
[
2
];
buflen
=
sizeof
chunk
-
2
*
sizeof
(
uint32_t
);
va_start
(
ap
,
fmt
);
i
=
vsnprintf
((
char
*
)
&
buf
[
2
],
len
,
fmt
,
ap
);
assert
(
i
>=
0
);
l
=
vsnprintf
(
buf
,
buf
len
,
fmt
,
ap
);
assert
(
l
>=
0
);
va_end
(
ap
);
if
(
i
<
len
)
len
=
i
;
buf
[
1
]
=
vtx
->
key
.
vxid
;
buf
[
0
]
=
((((
unsigned
)
SLT_VSL
&
0xff
)
<<
24
)
|
len
);
rec
.
ptr
=
buf
;
if
(
l
>
buflen
-
1
)
l
=
buflen
-
1
;
buf
[
l
++
]
=
'\0'
;
/* NUL-terminated */
chunk
[
1
]
=
vtx
->
key
.
vxid
;
chunk
[
0
]
=
((((
unsigned
)
SLT_VSL
&
0xff
)
<<
24
)
|
l
);
rec
.
ptr
=
chunk
;
rec
.
priv
=
0
;
vtx_append
(
vslq
,
vtx
,
&
rec
,
VSL_NEXT
(
rec
.
ptr
)
-
rec
.
ptr
,
1
);
...
...
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