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
8bfcc907
Commit
8bfcc907
authored
Jul 25, 2020
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little light house-cleaning
parent
24a9a569
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
41 deletions
+19
-41
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+1
-1
cache_http.c
bin/varnishd/cache/cache_http.c
+18
-40
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
8bfcc907
...
...
@@ -233,7 +233,6 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
http_ForceHeader
(
bo
->
bereq0
,
H_Accept_Encoding
,
"gzip"
);
}
http_ForceField
(
bo
->
bereq0
,
HTTP_HDR_PROTO
,
"HTTP/1.1"
);
http_CopyHome
(
bo
->
bereq0
);
if
(
bo
->
stale_oc
!=
NULL
&&
ObjCheckFlag
(
bo
->
wrk
,
bo
->
stale_oc
,
OF_IMSCAND
)
&&
...
...
@@ -249,6 +248,7 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
"If-None-Match: %s"
,
q
);
}
http_CopyHome
(
bo
->
bereq0
);
HTTP_Setup
(
bo
->
bereq
,
bo
->
ws
,
bo
->
vsl
,
SLT_BereqMethod
);
bo
->
ws_bo
=
WS_Snapshot
(
bo
->
ws
);
HTTP_Clone
(
bo
->
bereq
,
bo
->
bereq0
);
...
...
bin/varnishd/cache/cache_http.c
View file @
8bfcc907
...
...
@@ -291,12 +291,7 @@ http_PutField(struct http *to, int field, const char *string)
VSLb
(
to
->
vsl
,
SLT_LostHeader
,
"%s"
,
string
);
return
;
}
to
->
hd
[
field
].
b
=
p
;
to
->
hd
[
field
].
e
=
strchr
(
p
,
'\0'
);
to
->
hdf
[
field
]
=
0
;
http_VSLH
(
to
,
field
);
if
(
field
==
HTTP_HDR_PROTO
)
http_Proto
(
to
);
http_SetH
(
to
,
field
,
p
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -1138,29 +1133,6 @@ HTTP_Merge(struct worker *wrk, struct objcore *oc, struct http *to)
/*--------------------------------------------------------------------*/
static
void
http_filterfields
(
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
how
)
{
unsigned
u
;
CHECK_OBJ_NOTNULL
(
fm
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
to
,
HTTP_MAGIC
);
to
->
nhd
=
HTTP_HDR_FIRST
;
to
->
status
=
fm
->
status
;
for
(
u
=
HTTP_HDR_FIRST
;
u
<
fm
->
nhd
;
u
++
)
{
Tcheck
(
fm
->
hd
[
u
]);
if
(
http_isfiltered
(
fm
,
u
,
how
))
continue
;
assert
(
to
->
nhd
<
to
->
shd
);
to
->
hd
[
to
->
nhd
]
=
fm
->
hd
[
u
];
to
->
hdf
[
to
->
nhd
]
=
0
;
http_VSLH
(
to
,
to
->
nhd
);
to
->
nhd
++
;
}
}
/*--------------------------------------------------------------------*/
static
void
http_linkh
(
const
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
n
)
{
...
...
@@ -1177,6 +1149,8 @@ http_linkh(const struct http *to, const struct http *fm, unsigned n)
void
http_FilterReq
(
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
how
)
{
unsigned
u
;
CHECK_OBJ_NOTNULL
(
to
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
fm
,
HTTP_MAGIC
);
...
...
@@ -1184,7 +1158,19 @@ http_FilterReq(struct http *to, const struct http *fm, unsigned how)
http_linkh
(
to
,
fm
,
HTTP_HDR_URL
);
http_linkh
(
to
,
fm
,
HTTP_HDR_PROTO
);
to
->
protover
=
fm
->
protover
;
http_filterfields
(
to
,
fm
,
how
);
to
->
status
=
fm
->
status
;
to
->
nhd
=
HTTP_HDR_FIRST
;
for
(
u
=
HTTP_HDR_FIRST
;
u
<
fm
->
nhd
;
u
++
)
{
Tcheck
(
fm
->
hd
[
u
]);
if
(
http_isfiltered
(
fm
,
u
,
how
))
continue
;
assert
(
to
->
nhd
<
to
->
shd
);
to
->
hd
[
to
->
nhd
]
=
fm
->
hd
[
u
];
to
->
hdf
[
to
->
nhd
]
=
0
;
http_VSLH
(
to
,
to
->
nhd
);
to
->
nhd
++
;
}
}
/*--------------------------------------------------------------------
...
...
@@ -1267,11 +1253,7 @@ http_PrintfHeader(struct http *to, const char *fmt, ...)
http_fail
(
to
);
VSLbv
(
to
->
vsl
,
SLT_LostHeader
,
fmt
,
ap2
);
}
else
{
to
->
hd
[
to
->
nhd
].
b
=
p
;
to
->
hd
[
to
->
nhd
].
e
=
p
+
sz
;
to
->
hdf
[
to
->
nhd
]
=
0
;
http_VSLH
(
to
,
to
->
nhd
);
to
->
nhd
++
;
http_SetH
(
to
,
to
->
nhd
++
,
p
);
}
va_end
(
ap
);
va_end
(
ap2
);
...
...
@@ -1296,11 +1278,7 @@ http_TimeHeader(struct http *to, const char *fmt, vtim_real now)
}
strcpy
(
p
,
fmt
);
VTIM_format
(
now
,
strchr
(
p
,
'\0'
));
to
->
hd
[
to
->
nhd
].
b
=
p
;
to
->
hd
[
to
->
nhd
].
e
=
strchr
(
p
,
'\0'
);
to
->
hdf
[
to
->
nhd
]
=
0
;
http_VSLH
(
to
,
to
->
nhd
);
to
->
nhd
++
;
http_SetH
(
to
,
to
->
nhd
++
,
p
);
}
/*--------------------------------------------------------------------*/
...
...
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