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
a97f5ffd
Commit
a97f5ffd
authored
Jan 21, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replay SVN r5767
Roll out the gzip/gunzip logic some more
parent
da30ce1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
10 deletions
+39
-10
cache.h
bin/varnishd/cache.h
+2
-0
cache_center.c
bin/varnishd/cache_center.c
+37
-10
No files found.
bin/varnishd/cache.h
View file @
a97f5ffd
...
@@ -282,7 +282,9 @@ struct worker {
...
@@ -282,7 +282,9 @@ struct worker {
void
*
vfp_private
;
void
*
vfp_private
;
unsigned
do_esi
;
unsigned
do_esi
;
unsigned
do_gzip
;
unsigned
do_gzip
;
unsigned
is_gzip
;
unsigned
do_gunzip
;
unsigned
do_gunzip
;
unsigned
is_gunzip
;
/* ESI stuff */
/* ESI stuff */
struct
vep_state
*
vep
;
struct
vep_state
*
vep
;
...
...
bin/varnishd/cache_center.c
View file @
a97f5ffd
...
@@ -587,26 +587,53 @@ cnt_fetch(struct sess *sp)
...
@@ -587,26 +587,53 @@ cnt_fetch(struct sess *sp)
AZ
(
sp
->
wrk
->
vfp
);
AZ
(
sp
->
wrk
->
vfp
);
/* We won't gunzip unless it is gzip'ed, if we do remove C-E header */
/*
if
(
sp
->
wrk
->
do_gunzip
&&
* The VCL variables beresp.do_g[un]zip tells us how we want the
!
http_HdrIs
(
sp
->
wrk
->
beresp
,
H_Content_Encoding
,
"gzip"
))
* object stored.
*
* The backend Content-Encoding header tells us what we are going
* to receive, which we classify in the following three classes:
*
* "Content-Encoding: gzip" --> object is gzip'ed.
* no Content-Encoding --> object is not gzip'ed.
* anything else --> do nothing wrt gzip
*
*/
/* We do nothing unless the param is set */
if
(
!
params
->
http_gzip_support
)
sp
->
wrk
->
do_gzip
=
sp
->
wrk
->
do_gunzip
=
0
;
sp
->
wrk
->
is_gzip
=
http_HdrIs
(
sp
->
wrk
->
beresp
,
H_Content_Encoding
,
"gzip"
);
sp
->
wrk
->
is_gunzip
=
!
http_GetHdr
(
sp
->
wrk
->
beresp
,
H_Content_Encoding
,
NULL
);
/* It can't be both */
assert
(
sp
->
wrk
->
is_gzip
==
0
||
sp
->
wrk
->
is_gunzip
==
0
);
/* We won't gunzip unless it is gzip'ed */
if
(
sp
->
wrk
->
do_gunzip
&&
!
sp
->
wrk
->
is_gzip
)
sp
->
wrk
->
do_gunzip
=
0
;
sp
->
wrk
->
do_gunzip
=
0
;
if
(
sp
->
wrk
->
do_gunzip
)
http_Unset
(
sp
->
wrk
->
beresp
,
H_Content_Encoding
);
/* If we do gunzip, remove the C-E header */
if
(
sp
->
wrk
->
do_gunzip
)
http_Unset
(
sp
->
wrk
->
beresp
,
H_Content_Encoding
);
/* And we wont gzip if it already has a C-E header, if we do add it */
/* We wont gzip unless it is ungziped */
if
(
sp
->
wrk
->
do_gzip
&&
if
(
sp
->
wrk
->
do_gzip
&&
!
sp
->
wrk
->
is_gunzip
)
http_GetHdr
(
sp
->
wrk
->
beresp
,
H_Content_Encoding
,
NULL
))
sp
->
wrk
->
do_gzip
=
0
;
sp
->
wrk
->
do_gzip
=
0
;
/* If we do gzip, add the C-E header */
if
(
sp
->
wrk
->
do_gzip
)
if
(
sp
->
wrk
->
do_gzip
)
http_PrintfHeader
(
sp
->
wrk
,
sp
->
fd
,
sp
->
wrk
->
beresp
,
http_PrintfHeader
(
sp
->
wrk
,
sp
->
fd
,
sp
->
wrk
->
beresp
,
"Content-Encoding: %s"
,
"gzip"
);
"Content-Encoding: %s"
,
"gzip"
);
/* But we can't do both */
/* But we can't do both
at the same time
*/
assert
(
sp
->
wrk
->
do_gzip
==
0
||
sp
->
wrk
->
do_gunzip
==
0
);
assert
(
sp
->
wrk
->
do_gzip
==
0
||
sp
->
wrk
->
do_gunzip
==
0
);
/* ESI takes precedence and handles gzip/gunzip
also
*/
/* ESI takes precedence and handles gzip/gunzip
itself
*/
if
(
sp
->
wrk
->
do_esi
)
if
(
sp
->
wrk
->
do_esi
)
sp
->
wrk
->
vfp
=
&
vfp_esi
;
sp
->
wrk
->
vfp
=
&
vfp_esi
;
else
if
(
sp
->
wrk
->
do_gunzip
)
else
if
(
sp
->
wrk
->
do_gunzip
)
...
...
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