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
fd081460
Commit
fd081460
authored
Jan 22, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add another easy bit of code: including a ungzip'ed non-ESI object
in an gzip'ed ESI object.
parent
66e7a250
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
4 deletions
+29
-4
cache.h
bin/varnishd/cache.h
+1
-0
cache_esi_deliver.c
bin/varnishd/cache_esi_deliver.c
+17
-0
cache_response.c
bin/varnishd/cache_response.c
+2
-0
e00023.vtc
bin/varnishtest/tests/e00023.vtc
+9
-4
No files found.
bin/varnishd/cache.h
View file @
fd081460
...
@@ -815,6 +815,7 @@ char *VRT_String(struct ws *ws, const char *h, const char *p, va_list ap);
...
@@ -815,6 +815,7 @@ char *VRT_String(struct ws *ws, const char *h, const char *p, va_list ap);
char
*
VRT_StringList
(
char
*
d
,
unsigned
dl
,
const
char
*
p
,
va_list
ap
);
char
*
VRT_StringList
(
char
*
d
,
unsigned
dl
,
const
char
*
p
,
va_list
ap
);
void
ESI_Deliver
(
struct
sess
*
);
void
ESI_Deliver
(
struct
sess
*
);
void
ESI_DeliverChild
(
struct
sess
*
);
/* cache_vrt_vmod.c */
/* cache_vrt_vmod.c */
void
VMOD_Init
(
void
);
void
VMOD_Init
(
void
);
...
...
bin/varnishd/cache_esi_deliver.c
View file @
fd081460
...
@@ -333,3 +333,20 @@ ESI_Deliver(struct sess *sp)
...
@@ -333,3 +333,20 @@ ESI_Deliver(struct sess *sp)
}
}
(
void
)
WRW_Flush
(
sp
->
wrk
);
(
void
)
WRW_Flush
(
sp
->
wrk
);
}
}
/*---------------------------------------------------------------------
* Include an object in a gzip'ed ESI object delivery
*/
void
ESI_DeliverChild
(
struct
sess
*
sp
)
{
struct
storage
*
st
;
if
(
sp
->
obj
->
gziped
)
{
INCOMPL
();
}
else
{
VTAILQ_FOREACH
(
st
,
&
sp
->
obj
->
store
,
list
)
ved_pretend_gzip
(
sp
,
st
->
ptr
,
st
->
len
);
}
}
bin/varnishd/cache_response.c
View file @
fd081460
...
@@ -390,6 +390,8 @@ RES_WriteObj(struct sess *sp)
...
@@ -390,6 +390,8 @@ RES_WriteObj(struct sess *sp)
/* Nothing to do here */
/* Nothing to do here */
}
else
if
(
sp
->
wrk
->
res_mode
&
RES_ESI
)
{
}
else
if
(
sp
->
wrk
->
res_mode
&
RES_ESI
)
{
ESI_Deliver
(
sp
);
ESI_Deliver
(
sp
);
}
else
if
(
sp
->
wrk
->
res_mode
&
RES_ESI_CHILD
&&
sp
->
wrk
->
gzip_resp
)
{
ESI_DeliverChild
(
sp
);
}
else
if
(
sp
->
wrk
->
res_mode
&
RES_GUNZIP
)
{
}
else
if
(
sp
->
wrk
->
res_mode
&
RES_GUNZIP
)
{
res_WriteGunzipObj
(
sp
);
res_WriteGunzipObj
(
sp
);
}
else
{
}
else
{
...
...
bin/varnishtest/tests/e00023.vtc
View file @
fd081460
# $Id$
# $Id$
test "Include an ungzip'ed
ESI
object in a gzip'ed ESI object"
test "Include an ungzip'ed
(ESI)
object in a gzip'ed ESI object"
server s1 {
server s1 {
rxreq
rxreq
expect req.http.accept-encoding == gzip
expect req.http.accept-encoding == gzip
txresp -gzipbody {
txresp -gzipbody {
<html>
1
<html>
1
Before include 2
Before include
s
2
<esi:include
src=
"/foo"
/>
3
<esi:include
src=
"/foo"
/>
3
After include 4
Between includes 4
<esi:include
src=
"/bar"
/>
5
After includes 6
}
}
rxreq
rxreq
expect req.url == "/foo"
expect req.url == "/foo"
txresp -body {
<h1>
/////
<h2>
}
txresp -body {
<h1>
/////
<h2>
}
rxreq
expect req.url == "/bar"
txresp -body {*****}
} -start
} -start
varnish v1 -vcl+backend {
varnish v1 -vcl+backend {
...
@@ -33,7 +38,7 @@ client c1 {
...
@@ -33,7 +38,7 @@ client c1 {
expect resp.http.content-encoding == gzip
expect resp.http.content-encoding == gzip
gunzip
gunzip
expect resp.status == 200
expect resp.status == 200
expect resp.bodylen ==
79
expect resp.bodylen ==
115
}
}
client c1 -run
client c1 -run
...
...
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