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
3247c51d
Commit
3247c51d
authored
Oct 21, 2014
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make pretend_gzip a VDP
parent
16322792
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
13 deletions
+18
-13
cache.h
bin/varnishd/cache/cache.h
+1
-0
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+12
-13
cache_http1_deliver.c
bin/varnishd/http1/cache_http1_deliver.c
+5
-0
No files found.
bin/varnishd/cache/cache.h
View file @
3247c51d
...
...
@@ -1119,6 +1119,7 @@ void VRTPRIV_dynamic_kill(struct sess *sp, uintptr_t id);
void
ESI_Deliver
(
struct
req
*
);
void
ESI_DeliverChild
(
struct
req
*
);
vdp_bytes
VED_pretend_gzip
;
/* cache_vrt_vmod.c */
void
VMOD_Init
(
void
);
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
3247c51d
...
...
@@ -205,12 +205,18 @@ ved_decode_len(uint8_t **pp)
* the stream with a bit more overhead.
*/
static
int
ved_pretend_gzip
(
struct
req
*
req
,
const
uint8_t
*
p
,
ssize_t
l
)
int
__match_proto__
(
vdp_bytes
)
VED_pretend_gzip
(
struct
req
*
req
,
enum
vdp_action
act
,
const
void
*
pv
,
ssize_t
l
)
{
uint8_t
buf1
[
5
],
buf2
[
5
];
const
uint8_t
*
p
;
uint16_t
lx
;
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
(
void
)
act
;
p
=
pv
;
lx
=
65535
;
buf1
[
0
]
=
0
;
vle16enc
(
buf1
+
1
,
lx
);
...
...
@@ -355,7 +361,8 @@ ESI_Deliver(struct req *req)
* A gzip'ed ESI response, but the VEC
* was not gzip'ed.
*/
(
void
)
ved_pretend_gzip
(
req
,
pp
,
l2
);
(
void
)
VED_pretend_gzip
(
req
,
VDP_NULL
,
pp
,
l2
);
}
else
if
(
isgzip
)
{
/*
* A gzip'ed VEC, but ungzip'ed ESI
...
...
@@ -482,16 +489,8 @@ ESI_DeliverChild(struct req *req)
CHECK_OBJ_NOTNULL
(
req
,
REQ_MAGIC
);
CHECK_OBJ_NOTNULL
(
req
->
objcore
,
OBJCORE_MAGIC
);
if
(
!
ObjCheckFlag
(
req
->
wrk
,
req
->
objcore
,
OF_GZIPED
))
{
oi
=
ObjIterBegin
(
req
->
wrk
,
req
->
objcore
);
do
{
ois
=
ObjIter
(
req
->
objcore
,
oi
,
&
sp
,
&
sl
);
if
(
sl
>
0
&&
ved_pretend_gzip
(
req
,
sp
,
sl
))
break
;
}
while
(
ois
==
OIS_DATA
||
ois
==
OIS_STREAM
);
ObjIterEnd
(
req
->
objcore
,
&
oi
);
return
;
}
AN
(
ObjCheckFlag
(
req
->
wrk
,
req
->
objcore
,
OF_GZIPED
));
/*
* This is the interesting case: Deliver all the deflate
* blocks, stripping the "LAST" bit of the last one and
...
...
bin/varnishd/http1/cache_http1_deliver.c
View file @
3247c51d
...
...
@@ -340,6 +340,11 @@ V1D_Deliver(struct req *req, struct busyobj *bo)
/* This was a HEAD or conditional request */
}
else
if
(
req
->
res_mode
&
RES_ESI
)
{
ESI_Deliver
(
req
);
}
else
if
(
req
->
res_mode
&
RES_ESI_CHILD
&&
req
->
gzip_resp
&&
!
ObjCheckFlag
(
req
->
wrk
,
req
->
objcore
,
OF_GZIPED
))
{
VDP_push
(
req
,
VED_pretend_gzip
);
ois
=
v1d_WriteDirObj
(
req
);
VDP_pop
(
req
,
VED_pretend_gzip
);
}
else
if
(
req
->
res_mode
&
RES_ESI_CHILD
&&
req
->
gzip_resp
)
{
if
(
bo
!=
NULL
)
VBO_waitstate
(
bo
,
BOS_FINISHED
);
...
...
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