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
ca587d13
Commit
ca587d13
authored
Jan 15, 2012
by
Rogier 'DocWilco' Mulhuijzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify vry_cmp's signature
parent
5b8d8964
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
cache_vary.c
bin/varnishd/cache/cache_vary.c
+6
-6
No files found.
bin/varnishd/cache/cache_vary.c
View file @
ca587d13
...
...
@@ -145,18 +145,18 @@ vry_len(const uint8_t *p)
* Compare two vary entries
*/
static
int
vry_cmp
(
const
uint8_t
*
const
*
v1
,
uint8_t
*
cons
t
*
v2
)
vry_cmp
(
const
uint8_t
*
v1
,
const
uint8_
t
*
v2
)
{
unsigned
retval
=
0
;
if
(
!
memcmp
(
*
v1
,
*
v2
,
vry_len
(
*
v1
)))
{
if
(
!
memcmp
(
v1
,
v2
,
vry_len
(
v1
)))
{
/* Same same */
retval
=
0
;
}
else
if
(
memcmp
(
(
*
v1
)
+
2
,
(
*
v2
)
+
2
,
(
*
v1
)
[
2
]
+
2
))
{
}
else
if
(
memcmp
(
v1
+
2
,
v2
+
2
,
v1
[
2
]
+
2
))
{
/* Different header */
retval
=
1
;
}
else
if
(
cache_param
->
http_gzip_support
&&
!
strcasecmp
(
H_Accept_Encoding
,
(
const
char
*
)
((
*
v1
)
+
2
)
))
{
!
strcasecmp
(
H_Accept_Encoding
,
(
const
char
*
)
v1
+
2
))
{
/*
* If we do gzip processing, we do not vary on Accept-Encoding,
* because we want everybody to get the gzip'ed object, and
...
...
@@ -183,7 +183,7 @@ VRY_Match(const struct sess *sp, const uint8_t *vary)
AN
(
vsp
);
while
(
vary
[
2
])
{
i
=
vry_cmp
(
&
vary
,
&
vsp
);
i
=
vry_cmp
(
vary
,
vsp
);
if
(
i
==
1
)
{
/* Build a new entry */
...
...
@@ -222,7 +222,7 @@ VRY_Match(const struct sess *sp, const uint8_t *vary)
}
else
vsp
[
2
+
vary
[
2
]
+
2
+
2
]
=
'\0'
;
i
=
vry_cmp
(
&
vary
,
&
vsp
);
i
=
vry_cmp
(
vary
,
vsp
);
assert
(
i
!=
1
);
/* hdr must be the same now */
}
if
(
i
!=
0
)
...
...
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