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
dc4e7479
Commit
dc4e7479
authored
May 07, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Call ESI_Deliver() as a VDP.
Only allow VDP_ungzip to set a length if it is the top VDP.
parent
d8d9cd02
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
38 deletions
+13
-38
cache.h
bin/varnishd/cache/cache.h
+0
-1
cache_deliver_proc.c
bin/varnishd/cache/cache_deliver_proc.c
+0
-5
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+3
-28
cache_filter.h
bin/varnishd/cache/cache_filter.h
+1
-0
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+6
-2
cache_http1_deliver.c
bin/varnishd/http1/cache_http1_deliver.c
+3
-2
No files found.
bin/varnishd/cache/cache.h
View file @
dc4e7479
...
...
@@ -1107,7 +1107,6 @@ char *VRT_StringList(char *d, unsigned dl, const char *p, va_list ap);
void
VRTPRIV_init
(
struct
vrt_privs
*
privs
);
void
VRTPRIV_dynamic_kill
(
struct
vrt_privs
*
privs
,
uintptr_t
id
);
void
ESI_Deliver
(
struct
req
*
);
void
ESI_DeliverChild
(
struct
req
*
,
struct
busyobj
*
);
/* cache_vrt_vmod.c */
...
...
bin/varnishd/cache/cache_deliver_proc.c
View file @
dc4e7479
...
...
@@ -113,11 +113,6 @@ VDP_DeliverObj(struct req *req)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
if
(
req
->
res_mode
&
RES_ESI
)
{
ESI_Deliver
(
req
);
return
(
OIS_DONE
);
}
oi
=
ObjIterBegin
(
req
->
wrk
,
req
->
objcore
);
XXXAN
(
oi
);
AZ
(
req
->
synth_body
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
dc4e7479
...
...
@@ -286,7 +286,7 @@ struct ecx {
int
isgzip
;
};
static
int
__match_proto__
(
vdp_bytes
)
int
__match_proto__
(
vdp_bytes
)
VDP_ESI
(
struct
req
*
req
,
enum
vdp_action
act
,
void
**
priv
,
const
void
*
ptr
,
ssize_t
len
)
{
...
...
@@ -459,33 +459,6 @@ VDP_ESI(struct req *req, enum vdp_action act, void **priv,
}
}
/*---------------------------------------------------------------------
*/
void
ESI_Deliver
(
struct
req
*
req
)
{
enum
objiter_status
ois
;
void
*
sp
=
NULL
;
ssize_t
sl
;
void
*
oi
;
void
*
vp
=
NULL
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
(
void
)
VDP_ESI
(
req
,
VDP_INIT
,
&
vp
,
NULL
,
0
);
oi
=
ObjIterBegin
(
req
->
wrk
,
req
->
objcore
);
do
{
ois
=
ObjIter
(
req
->
objcore
,
oi
,
&
sp
,
&
sl
);
assert
(
ois
!=
OIS_ERROR
);
(
void
)
VDP_ESI
(
req
,
VDP_FLUSH
,
&
vp
,
sp
,
sl
);
}
while
(
ois
!=
OIS_DONE
);
(
void
)
VDP_ESI
(
req
,
VDP_FINI
,
&
vp
,
NULL
,
0
);
ObjIterEnd
(
req
->
objcore
,
&
oi
);
}
/*---------------------------------------------------------------------
* Include an object in a gzip'ed ESI object delivery
*/
...
...
@@ -693,6 +666,8 @@ ESI_DeliverChild(struct req *req, struct busyobj *bo)
ved_stripgzip
(
req
);
(
void
)
VDP_bytes
(
req
,
VDP_FLUSH
,
NULL
,
0
);
}
else
{
if
(
req
->
res_mode
&
RES_ESI
)
VDP_push
(
req
,
VDP_ESI
,
NULL
,
0
);
if
(
req
->
gzip_resp
&&
!
i
)
VDP_push
(
req
,
ved_pretend_gzip
,
NULL
,
0
);
else
if
(
!
req
->
gzip_resp
&&
i
)
...
...
bin/varnishd/cache/cache_filter.h
View file @
dc4e7479
...
...
@@ -111,3 +111,4 @@ void VDP_close(struct req *req);
enum
objiter_status
VDP_DeliverObj
(
struct
req
*
req
);
vdp_bytes
VDP_gunzip
;
vdp_bytes
VDP_ESI
;
bin/varnishd/cache/cache_gzip.c
View file @
dc4e7479
...
...
@@ -296,8 +296,12 @@ VDP_gunzip(struct req *req, enum vdp_action act, void **priv,
p
=
ObjGetattr
(
req
->
wrk
,
req
->
objcore
,
OA_GZIPBITS
,
&
dl
);
if
(
p
!=
NULL
&&
dl
==
32
)
{
u
=
vbe64dec
(
p
+
24
);
/* XXX: Zero is suspect: OA_GZIPBITS wasn't set */
if
(
u
!=
0
)
/*
* If the size is non-zero, and we are the top
* VDP, we know what size the output will be.
*/
if
(
u
!=
0
&&
VTAILQ_FIRST
(
&
req
->
vdp
)
->
func
==
VDP_gunzip
)
req
->
resp_len
=
u
;
else
req
->
resp_len
=
-
1
;
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
dc4e7479
...
...
@@ -90,6 +90,7 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
if
(
req
->
res_mode
&
RES_ESI
)
{
RFC2616_Weaken_Etag
(
req
->
resp
);
VDP_push
(
req
,
VDP_ESI
,
NULL
,
0
);
}
else
if
(
http_IsStatus
(
req
->
resp
,
304
))
{
http_Unset
(
req
->
resp
,
H_Content_Length
);
req
->
wantbody
=
0
;
...
...
@@ -105,13 +106,13 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
* XXX: with multiple writes because of the gunzip buffer
*/
req
->
res_mode
|=
RES_GUNZIP
;
VDP_push
(
req
,
VDP_gunzip
,
NULL
,
0
);
VDP_push
(
req
,
VDP_gunzip
,
NULL
,
1
);
}
if
(
req
->
res_mode
&
RES_ESI
)
{
/* Gunzip could have added back a C-L */
http_Unset
(
req
->
resp
,
H_Content_Length
);
req
->
resp_len
=
-
1
;
assert
(
req
->
resp_len
<
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