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
a4f9ef96
Commit
a4f9ef96
authored
Oct 31, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use a tag flag to mark binary log records
parent
67252219
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
vsl.h
include/vapi/vsl.h
+5
-0
vsl.c
lib/libvarnishapi/vsl.c
+8
-2
No files found.
include/vapi/vsl.h
View file @
a4f9ef96
...
@@ -111,6 +111,11 @@ extern const char *VSL_tags[SLT__MAX];
...
@@ -111,6 +111,11 @@ extern const char *VSL_tags[SLT__MAX];
* Tag to string array. Contains NULL for invalid tags.
* Tag to string array. Contains NULL for invalid tags.
*/
*/
extern
unsigned
VSL_tagflags
[
SLT__MAX
];
/*
* Tag flags array.
*/
int
VSL_Name2Tag
(
const
char
*
name
,
int
l
);
int
VSL_Name2Tag
(
const
char
*
name
,
int
l
);
/*
/*
* Convert string to tag number (= enum VSL_tag_e). Name can be a
* Convert string to tag number (= enum VSL_tag_e). Name can be a
...
...
lib/libvarnishapi/vsl.c
View file @
a4f9ef96
...
@@ -63,6 +63,12 @@ const char *VSL_tags[SLT__MAX] = {
...
@@ -63,6 +63,12 @@ const char *VSL_tags[SLT__MAX] = {
# undef SLTM
# undef SLTM
};
};
unsigned
VSL_tagflags
[
SLT__MAX
]
=
{
# define SLTM(foo, flags, sdesc, ldesc) [SLT_##foo] = flags,
# include "tbl/vsl_tags.h"
# undef SLTM
};
int
int
vsl_diag
(
struct
VSL_data
*
vsl
,
const
char
*
fmt
,
...)
vsl_diag
(
struct
VSL_data
*
vsl
,
const
char
*
fmt
,
...)
{
{
...
@@ -246,7 +252,7 @@ VSL_Print(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
...
@@ -246,7 +252,7 @@ VSL_Print(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
'b'
:
'-'
;
'b'
:
'-'
;
data
=
VSL_CDATA
(
c
->
rec
.
ptr
);
data
=
VSL_CDATA
(
c
->
rec
.
ptr
);
if
(
tag
==
SLT_Debug
)
{
if
(
VSL_tagflags
[
tag
]
&
SLT_F_BINARY
)
{
VSL_PRINT
(
fo
,
"%10u %-14s %c
\"
"
,
vxid
,
VSL_tags
[
tag
],
type
);
VSL_PRINT
(
fo
,
"%10u %-14s %c
\"
"
,
vxid
,
VSL_tags
[
tag
],
type
);
while
(
len
--
>
0
)
{
while
(
len
--
>
0
)
{
if
(
*
data
>=
' '
&&
*
data
<=
'~'
)
if
(
*
data
>=
' '
&&
*
data
<=
'~'
)
...
@@ -279,7 +285,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
...
@@ -279,7 +285,7 @@ VSL_PrintTerse(const struct VSL_data *vsl, const struct VSL_cursor *c, void *fo)
len
=
VSL_LEN
(
c
->
rec
.
ptr
);
len
=
VSL_LEN
(
c
->
rec
.
ptr
);
data
=
VSL_CDATA
(
c
->
rec
.
ptr
);
data
=
VSL_CDATA
(
c
->
rec
.
ptr
);
if
(
tag
==
SLT_Debug
)
{
if
(
VSL_tagflags
[
tag
]
&
SLT_F_BINARY
)
{
VSL_PRINT
(
fo
,
"%-14s
\"
"
,
VSL_tags
[
tag
]);
VSL_PRINT
(
fo
,
"%-14s
\"
"
,
VSL_tags
[
tag
]);
while
(
len
--
>
0
)
{
while
(
len
--
>
0
)
{
if
(
*
data
>=
' '
&&
*
data
<=
'~'
)
if
(
*
data
>=
' '
&&
*
data
<=
'~'
)
...
...
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