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
576ca628
Commit
576ca628
authored
Aug 01, 2013
by
Joshua Bussdieker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add parameter type
parent
5e1b4247
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
cache_key.c
bin/varnishd/cache/cache_key.c
+30
-0
No files found.
bin/varnishd/cache/cache_key.c
View file @
576ca628
...
...
@@ -14,6 +14,7 @@
#define M_BEGINNING 3
#define M_CASE 4
#define M_NOT 5
#define M_PARAMETER 6
int
enum_matchers
(
const
char
*
matcher
,
int
*
type
,
const
char
**
param
,
int
*
s
)
{
const
char
*
p
=
matcher
;
...
...
@@ -54,6 +55,16 @@ int enum_matchers(const char *matcher, int *type, const char **param, int *s) {
*
s
=
(
int
)(
e
-
p
);
*
type
=
M_BEGINNING
;
p
=
e
+
1
;
}
else
if
(
strncmp
(
p
,
"p=
\"
"
,
3
)
==
0
)
{
p
+=
3
;
for
(
e
=
p
;
*
e
&&
(
*
e
!=
'\"'
||
e
[
-
1
]
==
'\\'
);
e
++
)
continue
;
if
(
!*
e
)
return
-
1
;
*
param
=
p
;
*
s
=
(
int
)(
e
-
p
);
*
type
=
M_PARAMETER
;
p
=
e
+
1
;
}
else
if
(
*
p
==
'c'
)
{
*
s
=
0
;
*
type
=
M_CASE
;
...
...
@@ -189,6 +200,25 @@ int beginning_substring_matcher(const char *p, const char *fv, int ps, int case_
return
0
;
}
int
parameter_prefix_matcher
(
const
char
*
p
,
const
char
*
fv
,
int
ps
,
int
case_sensitive
)
{
int
read
,
size
,
offset
=
0
;
const
char
*
match
;
while
(
read
=
enum_fields
(
fv
+
offset
,
&
match
,
&
size
))
{
if
(
ps
<=
size
)
{
if
(
cmp_func
(
match
,
p
,
ps
,
case_sensitive
)
==
0
)
{
char
*
r
;
for
(
r
=
match
+
ps
;
r
<
match
+
size
&&
*
r
==
' '
;
r
++
)
continue
;
if
(
*
r
==
';'
||
r
==
match
+
size
)
return
1
;
}
}
offset
+=
read
;
}
return
0
;
}
/*
* Find length of a key entry
*/
...
...
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