Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
unique-xids
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
unique-xids
Commits
4c8f484e
Commit
4c8f484e
authored
Jan 17, 2012
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A bit of cleanup of the filtering stuff
parent
dd103d37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
25 deletions
+14
-25
cache_http.c
bin/varnishd/cache/cache_http.c
+14
-25
No files found.
bin/varnishd/cache/cache_http.c
View file @
4c8f484e
...
...
@@ -748,7 +748,7 @@ http_SetH(const struct http *to, unsigned n, const char *fm)
}
static
void
http_
copy
h
(
const
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
n
)
http_
link
h
(
const
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
n
)
{
assert
(
n
<
HTTP_HDR_FIRST
);
...
...
@@ -776,25 +776,6 @@ http_SetResp(struct http *to, const char *proto, uint16_t status,
http_SetH
(
to
,
HTTP_HDR_RESPONSE
,
response
);
}
static
void
http_copyheader
(
struct
worker
*
w
,
unsigned
vsl_id
,
struct
http
*
to
,
const
struct
http
*
fm
,
unsigned
n
)
{
CHECK_OBJ_NOTNULL
(
fm
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
to
,
HTTP_MAGIC
);
assert
(
n
<
fm
->
shd
);
Tcheck
(
fm
->
hd
[
n
]);
if
(
to
->
nhd
<
to
->
shd
)
{
to
->
hd
[
to
->
nhd
]
=
fm
->
hd
[
n
];
to
->
hdf
[
to
->
nhd
]
=
0
;
to
->
nhd
++
;
}
else
{
VSC_C_main
->
losthdr
++
;
WSLR
(
w
,
SLT_LostHeader
,
vsl_id
,
fm
->
hd
[
n
]);
}
}
/*--------------------------------------------------------------------
* Estimate how much workspace we need to Filter this header according
* to 'how'.
...
...
@@ -847,7 +828,15 @@ http_filterfields(struct worker *w, unsigned vsl_id, struct http *to,
continue;
#include "tbl/http_headers.h"
#undef HTTPH
http_copyheader
(
w
,
vsl_id
,
to
,
fm
,
u
);
Tcheck
(
fm
->
hd
[
u
]);
if
(
to
->
nhd
<
to
->
shd
)
{
to
->
hd
[
to
->
nhd
]
=
fm
->
hd
[
u
];
to
->
hdf
[
to
->
nhd
]
=
0
;
to
->
nhd
++
;
}
else
{
VSC_C_main
->
losthdr
++
;
WSLR
(
w
,
SLT_LostHeader
,
vsl_id
,
fm
->
hd
[
u
]);
}
}
}
...
...
@@ -862,12 +851,12 @@ http_FilterReq(const struct sess *sp, unsigned how)
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
hp
->
logtag
=
HTTP_Tx
;
http_
copy
h
(
hp
,
sp
->
req
->
http
,
HTTP_HDR_REQ
);
http_
copy
h
(
hp
,
sp
->
req
->
http
,
HTTP_HDR_URL
);
http_
link
h
(
hp
,
sp
->
req
->
http
,
HTTP_HDR_REQ
);
http_
link
h
(
hp
,
sp
->
req
->
http
,
HTTP_HDR_URL
);
if
(
how
==
HTTPH_R_FETCH
)
http_SetH
(
hp
,
HTTP_HDR_PROTO
,
"HTTP/1.1"
);
else
http_
copy
h
(
hp
,
sp
->
req
->
http
,
HTTP_HDR_PROTO
);
http_
link
h
(
hp
,
sp
->
req
->
http
,
HTTP_HDR_PROTO
);
http_filterfields
(
sp
->
wrk
,
sp
->
vsl_id
,
hp
,
sp
->
req
->
http
,
how
);
http_PrintfHeader
(
sp
->
wrk
,
sp
->
vsl_id
,
hp
,
"X-Varnish: %u"
,
sp
->
req
->
xid
);
...
...
@@ -884,7 +873,7 @@ http_FilterResp(const struct sess *sp, const struct http *fm, struct http *to,
CHECK_OBJ_NOTNULL
(
to
,
HTTP_MAGIC
);
http_SetH
(
to
,
HTTP_HDR_PROTO
,
"HTTP/1.1"
);
to
->
status
=
fm
->
status
;
http_
copy
h
(
to
,
fm
,
HTTP_HDR_RESPONSE
);
http_
link
h
(
to
,
fm
,
HTTP_HDR_RESPONSE
);
http_filterfields
(
sp
->
wrk
,
sp
->
vsl_id
,
to
,
fm
,
how
);
}
...
...
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