Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnishevent3
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
varnishevent3
Commits
b6e6fe93
Commit
b6e6fe93
authored
Jun 21, 2011
by
Poul-Henning Kamp
Committed by
Tollef Fog Heen
Aug 16, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use VCT instead of <ctype.h>. Trust HTTP_GetHdr() to remove leading
white space.
parent
22c0814c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
cache_vary.c
bin/varnishd/cache_vary.c
+9
-12
No files found.
bin/varnishd/cache_vary.c
View file @
b6e6fe93
...
...
@@ -54,11 +54,11 @@
#include "config.h"
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "cache.h"
#include "vct.h"
struct
vsb
*
VRY_Create
(
const
struct
sess
*
sp
,
const
struct
http
*
hp
)
...
...
@@ -86,9 +86,9 @@ VRY_Create(const struct sess *sp, const struct http *hp)
for
(
p
=
v
;
*
p
;
p
++
)
{
/* Find next header-name */
if
(
isspace
(
*
p
))
if
(
vct_issp
(
*
p
))
continue
;
for
(
q
=
p
;
*
q
&&
!
isspace
(
*
q
)
&&
*
q
!=
','
;
q
++
)
for
(
q
=
p
;
*
q
&&
!
vct_issp
(
*
q
)
&&
*
q
!=
','
;
q
++
)
continue
;
/* Build a header-matching string out of it */
...
...
@@ -98,11 +98,10 @@ VRY_Create(const struct sess *sp, const struct http *hp)
AZ
(
VSB_finish
(
sbh
));
if
(
http_GetHdr
(
sp
->
http
,
VSB_data
(
sbh
),
&
h
))
{
/* Trim leading and trailing space */
while
(
isspace
(
*
h
))
h
++
;
AZ
(
vct_issp
(
*
h
));
/* Trim trailing space */
e
=
strchr
(
h
,
'\0'
);
while
(
e
>
h
&&
isspace
(
e
[
-
1
]))
while
(
e
>
h
&&
vct_issp
(
e
[
-
1
]))
e
--
;
/* Encode two byte length and contents */
l
=
e
-
h
;
...
...
@@ -117,7 +116,7 @@ VRY_Create(const struct sess *sp, const struct http *hp)
if
(
e
!=
h
)
VSB_bcat
(
sb
,
h
,
e
-
h
);
while
(
isspace
(
*
q
))
while
(
vct_issp
(
*
q
))
q
++
;
if
(
*
q
==
'\0'
)
break
;
...
...
@@ -175,11 +174,9 @@ VRY_Match(const struct sess *sp, const uint8_t *vary)
if
(
!
i
)
continue
;
/* Trim leading & trailing space */
while
(
isspace
(
*
h
))
h
++
;
/* Trim trailing space */
e
=
strchr
(
h
,
'\0'
);
while
(
e
>
h
&&
isspace
(
e
[
-
1
]))
while
(
e
>
h
&&
vct_issp
(
e
[
-
1
]))
e
--
;
/* Fail if wrong length */
...
...
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