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
79b63330
Commit
79b63330
authored
Sep 24, 2013
by
Martin Blix Grydeland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use VSL_List2Tags in -ix option processing
parent
8b66fc69
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
34 deletions
+34
-34
vapi_options.h
include/vapi/vapi_options.h
+7
-5
vsl_arg.c
lib/libvarnishapi/vsl_arg.c
+27
-29
No files found.
include/vapi/vapi_options.h
View file @
79b63330
...
...
@@ -66,8 +66,9 @@
)
#define VSL_OPT_i \
VOPT("i:", "[-i tag]", "Include tag", \
"Include log records of this tag in output. Multiple -i" \
VOPT("i:", "[-i taglist]", "Include tags", \
"Include log records of these tags in output. Taglist is" \
" a comma-separated list of tag globs. Multiple -i" \
" options may be given.\n" \
"\n" \
VSL_iI_PS \
...
...
@@ -109,9 +110,10 @@
)
#define VSL_OPT_x \
VOPT("x:", "[-x tag]", "Exclude tag", \
"Exclude log records of this tag in output. Multiple -x" \
" options may be given." \
VOPT("x:", "[-x taglist]", "Exclude tags", \
"Exclude log records of these tags in output. Taglist is" \
" a comma-separated list of tag globs. Multiple -x" \
" options may be given.\n" \
)
#define VSL_OPT_X \
...
...
lib/libvarnishapi/vsl_arg.c
View file @
79b63330
...
...
@@ -212,42 +212,40 @@ VSLQ_Name2Grouping(const char *name, int l)
return
(
n
);
}
static
void
vsl_vbm_bitset
(
int
bit
,
void
*
priv
)
{
vbit_set
((
struct
vbitmap
*
)
priv
,
bit
);
}
static
void
vsl_vbm_bitclr
(
int
bit
,
void
*
priv
)
{
vbit_clr
((
struct
vbitmap
*
)
priv
,
bit
);
}
static
int
vsl_ix_arg
(
struct
VSL_data
*
vsl
,
int
opt
,
const
char
*
arg
)
{
int
i
,
l
;
const
char
*
b
,
*
e
;
int
i
;
CHECK_OBJ_NOTNULL
(
vsl
,
VSL_MAGIC
);
vsl
->
flags
|=
F_SEEN_ixIX
;
for
(
b
=
arg
;
*
b
;
b
=
e
)
{
while
(
isspace
(
*
b
))
b
++
;
e
=
strchr
(
b
,
','
);
if
(
e
==
NULL
)
e
=
strchr
(
b
,
'\0'
);
l
=
e
-
b
;
if
(
*
e
==
','
)
e
++
;
while
(
isspace
(
b
[
l
-
1
]))
l
--
;
i
=
VSL_Name2Tag
(
b
,
l
);
if
(
i
>=
0
)
{
if
(
opt
==
'x'
)
vbit_set
(
vsl
->
vbm_supress
,
i
);
else
vbit_clr
(
vsl
->
vbm_supress
,
i
);
}
else
if
(
i
==
-
2
)
{
return
(
vsl_diag
(
vsl
,
"-%c:
\"
%*.*s
\"
matches multiple tags
\n
"
,
(
char
)
opt
,
l
,
l
,
b
));
}
else
{
return
(
vsl_diag
(
vsl
,
"-%c: Could not match
\"
%*.*s
\"
to any tag
\n
"
,
(
char
)
opt
,
l
,
l
,
b
));
}
}
i
=
VSL_List2Tags
(
arg
,
-
1
,
opt
==
'x'
?
vsl_vbm_bitset
:
vsl_vbm_bitclr
,
vsl
->
vbm_supress
);
if
(
i
==
-
1
)
return
(
vsl_diag
(
vsl
,
"-%c:
\"
%s
\"
matches zero tags"
,
(
char
)
opt
,
arg
));
else
if
(
i
==
-
2
)
return
(
vsl_diag
(
vsl
,
"-%c:
\"
%s
\"
is ambiguous"
,
(
char
)
opt
,
arg
));
else
if
(
i
==
-
3
)
return
(
vsl_diag
(
vsl
,
"-%c: Syntax error in
\"
%s
\"
"
,
(
char
)
opt
,
arg
));
return
(
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