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
22c90f14
Commit
22c90f14
authored
Nov 30, 2011
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move do_gzip, do_gunzip and do_esi from worker to busyobj
parent
bd4d3401
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
47 deletions
+35
-47
cache.h
bin/varnishd/cache/cache.h
+4
-3
cache_center.c
bin/varnishd/cache/cache_center.c
+21
-31
cache_esi_deliver.c
bin/varnishd/cache/cache_esi_deliver.c
+0
-3
cache_esi_fetch.c
bin/varnishd/cache/cache_esi_fetch.c
+4
-4
cache_panic.c
bin/varnishd/cache/cache_panic.c
+3
-3
cache_vrt_var.c
bin/varnishd/cache/cache_vrt_var.c
+3
-3
No files found.
bin/varnishd/cache/cache.h
View file @
22c90f14
...
@@ -333,9 +333,6 @@ struct worker {
...
@@ -333,9 +333,6 @@ struct worker {
struct
vbc
*
vbc
;
struct
vbc
*
vbc
;
unsigned
do_stream
;
unsigned
do_stream
;
unsigned
do_esi
;
unsigned
do_gzip
;
unsigned
do_gunzip
;
unsigned
do_close
;
unsigned
do_close
;
char
*
h_content_length
;
char
*
h_content_length
;
...
@@ -507,6 +504,10 @@ struct busyobj {
...
@@ -507,6 +504,10 @@ struct busyobj {
enum
body_status
body_status
;
enum
body_status
body_status
;
struct
vef_priv
*
vef_priv
;
struct
vef_priv
*
vef_priv
;
unsigned
do_esi
;
unsigned
do_gzip
;
unsigned
do_gunzip
;
};
};
/* Object structure --------------------------------------------------*/
/* Object structure --------------------------------------------------*/
...
...
bin/varnishd/cache/cache_center.c
View file @
22c90f14
...
@@ -184,8 +184,12 @@ cnt_prepresp(struct sess *sp)
...
@@ -184,8 +184,12 @@ cnt_prepresp(struct sess *sp)
wrk
->
res_mode
=
0
;
wrk
->
res_mode
=
0
;
if
((
wrk
->
h_content_length
!=
NULL
||
!
wrk
->
do_stream
)
&&
if
(
wrk
->
busyobj
==
NULL
)
!
wrk
->
do_gzip
&&
!
wrk
->
do_gunzip
)
wrk
->
res_mode
|=
RES_LEN
;
if
(
wrk
->
busyobj
!=
NULL
&&
(
wrk
->
h_content_length
!=
NULL
||
!
wrk
->
do_stream
)
&&
!
wrk
->
busyobj
->
do_gzip
&&
!
wrk
->
busyobj
->
do_gunzip
)
wrk
->
res_mode
|=
RES_LEN
;
wrk
->
res_mode
|=
RES_LEN
;
if
(
!
sp
->
disable_esi
&&
wrk
->
obj
->
esidata
!=
NULL
)
{
if
(
!
sp
->
disable_esi
&&
wrk
->
obj
->
esidata
!=
NULL
)
{
...
@@ -339,9 +343,6 @@ cnt_done(struct sess *sp)
...
@@ -339,9 +343,6 @@ cnt_done(struct sess *sp)
wrk
->
busyobj
=
NULL
;
wrk
->
busyobj
=
NULL
;
wrk
->
do_esi
=
0
;
wrk
->
do_gunzip
=
0
;
wrk
->
do_gzip
=
0
;
wrk
->
do_stream
=
0
;
wrk
->
do_stream
=
0
;
SES_Charge
(
sp
);
SES_Charge
(
sp
);
...
@@ -457,9 +458,6 @@ cnt_error(struct sess *sp)
...
@@ -457,9 +458,6 @@ cnt_error(struct sess *sp)
wrk
=
sp
->
wrk
;
wrk
=
sp
->
wrk
;
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
CHECK_OBJ_NOTNULL
(
wrk
,
WORKER_MAGIC
);
wrk
->
do_esi
=
0
;
wrk
->
do_gzip
=
0
;
wrk
->
do_gunzip
=
0
;
wrk
->
do_stream
=
0
;
wrk
->
do_stream
=
0
;
if
(
wrk
->
obj
==
NULL
)
{
if
(
wrk
->
obj
==
NULL
)
{
...
@@ -621,7 +619,7 @@ cnt_fetch(struct sess *sp)
...
@@ -621,7 +619,7 @@ cnt_fetch(struct sess *sp)
if
(
wrk
->
objcore
==
NULL
)
if
(
wrk
->
objcore
==
NULL
)
wrk
->
busyobj
->
exp
.
ttl
=
-
1
.;
wrk
->
busyobj
->
exp
.
ttl
=
-
1
.;
AZ
(
wrk
->
do_esi
);
AZ
(
wrk
->
busyobj
->
do_esi
);
VCL_fetch_method
(
sp
);
VCL_fetch_method
(
sp
);
...
@@ -740,7 +738,7 @@ cnt_fetchbody(struct sess *sp)
...
@@ -740,7 +738,7 @@ cnt_fetchbody(struct sess *sp)
/* We do nothing unless the param is set */
/* We do nothing unless the param is set */
if
(
!
cache_param
->
http_gzip_support
)
if
(
!
cache_param
->
http_gzip_support
)
wrk
->
do_gzip
=
wrk
->
do_gunzip
=
0
;
wrk
->
busyobj
->
do_gzip
=
wrk
->
busyobj
->
do_gunzip
=
0
;
wrk
->
busyobj
->
is_gzip
=
wrk
->
busyobj
->
is_gzip
=
http_HdrIs
(
wrk
->
beresp
,
H_Content_Encoding
,
"gzip"
);
http_HdrIs
(
wrk
->
beresp
,
H_Content_Encoding
,
"gzip"
);
...
@@ -752,36 +750,36 @@ cnt_fetchbody(struct sess *sp)
...
@@ -752,36 +750,36 @@ cnt_fetchbody(struct sess *sp)
assert
(
wrk
->
busyobj
->
is_gzip
==
0
||
wrk
->
busyobj
->
is_gunzip
==
0
);
assert
(
wrk
->
busyobj
->
is_gzip
==
0
||
wrk
->
busyobj
->
is_gunzip
==
0
);
/* We won't gunzip unless it is gzip'ed */
/* We won't gunzip unless it is gzip'ed */
if
(
wrk
->
do_gunzip
&&
!
wrk
->
busyobj
->
is_gzip
)
if
(
wrk
->
busyobj
->
do_gunzip
&&
!
wrk
->
busyobj
->
is_gzip
)
wrk
->
do_gunzip
=
0
;
wrk
->
busyobj
->
do_gunzip
=
0
;
/* If we do gunzip, remove the C-E header */
/* If we do gunzip, remove the C-E header */
if
(
wrk
->
do_gunzip
)
if
(
wrk
->
busyobj
->
do_gunzip
)
http_Unset
(
wrk
->
beresp
,
H_Content_Encoding
);
http_Unset
(
wrk
->
beresp
,
H_Content_Encoding
);
/* We wont gzip unless it is ungziped */
/* We wont gzip unless it is ungziped */
if
(
wrk
->
do_gzip
&&
!
wrk
->
busyobj
->
is_gunzip
)
if
(
wrk
->
busyobj
->
do_gzip
&&
!
wrk
->
busyobj
->
is_gunzip
)
wrk
->
do_gzip
=
0
;
wrk
->
busyobj
->
do_gzip
=
0
;
/* If we do gzip, add the C-E header */
/* If we do gzip, add the C-E header */
if
(
wrk
->
do_gzip
)
if
(
wrk
->
busyobj
->
do_gzip
)
http_SetHeader
(
wrk
,
sp
->
vsl_id
,
wrk
->
beresp
,
http_SetHeader
(
wrk
,
sp
->
vsl_id
,
wrk
->
beresp
,
"Content-Encoding: gzip"
);
"Content-Encoding: gzip"
);
/* But we can't do both at the same time */
/* But we can't do both at the same time */
assert
(
wrk
->
do_gzip
==
0
||
wrk
->
do_gunzip
==
0
);
assert
(
wrk
->
busyobj
->
do_gzip
==
0
||
wrk
->
busyobj
->
do_gunzip
==
0
);
/* ESI takes precedence and handles gzip/gunzip itself */
/* ESI takes precedence and handles gzip/gunzip itself */
if
(
wrk
->
do_esi
)
if
(
wrk
->
busyobj
->
do_esi
)
wrk
->
busyobj
->
vfp
=
&
vfp_esi
;
wrk
->
busyobj
->
vfp
=
&
vfp_esi
;
else
if
(
wrk
->
do_gunzip
)
else
if
(
wrk
->
busyobj
->
do_gunzip
)
wrk
->
busyobj
->
vfp
=
&
vfp_gunzip
;
wrk
->
busyobj
->
vfp
=
&
vfp_gunzip
;
else
if
(
wrk
->
do_gzip
)
else
if
(
wrk
->
busyobj
->
do_gzip
)
wrk
->
busyobj
->
vfp
=
&
vfp_gzip
;
wrk
->
busyobj
->
vfp
=
&
vfp_gzip
;
else
if
(
wrk
->
busyobj
->
is_gzip
)
else
if
(
wrk
->
busyobj
->
is_gzip
)
wrk
->
busyobj
->
vfp
=
&
vfp_testgzip
;
wrk
->
busyobj
->
vfp
=
&
vfp_testgzip
;
if
(
wrk
->
do_esi
||
sp
->
esi_level
>
0
)
if
(
wrk
->
busyobj
->
do_esi
||
sp
->
esi_level
>
0
)
wrk
->
do_stream
=
0
;
wrk
->
do_stream
=
0
;
if
(
!
sp
->
wantbody
)
if
(
!
sp
->
wantbody
)
wrk
->
do_stream
=
0
;
wrk
->
do_stream
=
0
;
...
@@ -832,7 +830,8 @@ cnt_fetchbody(struct sess *sp)
...
@@ -832,7 +830,8 @@ cnt_fetchbody(struct sess *sp)
wrk
->
storage_hint
=
NULL
;
wrk
->
storage_hint
=
NULL
;
if
(
wrk
->
do_gzip
||
(
wrk
->
busyobj
->
is_gzip
&&
!
wrk
->
do_gunzip
))
if
(
wrk
->
busyobj
->
do_gzip
||
(
wrk
->
busyobj
->
is_gzip
&&
!
wrk
->
busyobj
->
do_gunzip
))
wrk
->
obj
->
gziped
=
1
;
wrk
->
obj
->
gziped
=
1
;
if
(
vary
!=
NULL
)
{
if
(
vary
!=
NULL
)
{
...
@@ -1470,9 +1469,6 @@ cnt_recv(struct sess *sp)
...
@@ -1470,9 +1469,6 @@ cnt_recv(struct sess *sp)
}
}
/* Zap these, in case we came here through restart */
/* Zap these, in case we came here through restart */
wrk
->
do_esi
=
0
;
wrk
->
do_gzip
=
0
;
wrk
->
do_gunzip
=
0
;
wrk
->
do_stream
=
0
;
wrk
->
do_stream
=
0
;
if
(
cache_param
->
http_gzip_support
&&
if
(
cache_param
->
http_gzip_support
&&
...
@@ -1656,9 +1652,6 @@ CNT_Session(struct sess *sp)
...
@@ -1656,9 +1652,6 @@ CNT_Session(struct sess *sp)
sp
->
step
==
STP_RECV
);
sp
->
step
==
STP_RECV
);
AZ
(
wrk
->
do_stream
);
AZ
(
wrk
->
do_stream
);
AZ
(
wrk
->
do_gzip
);
AZ
(
wrk
->
do_gunzip
);
AZ
(
wrk
->
do_esi
);
AZ
(
wrk
->
obj
);
AZ
(
wrk
->
obj
);
AZ
(
wrk
->
objcore
);
AZ
(
wrk
->
objcore
);
...
@@ -1713,9 +1706,6 @@ CNT_Session(struct sess *sp)
...
@@ -1713,9 +1706,6 @@ CNT_Session(struct sess *sp)
AZ
(
wrk
->
obj
);
AZ
(
wrk
->
obj
);
AZ
(
wrk
->
objcore
);
AZ
(
wrk
->
objcore
);
AZ
(
wrk
->
do_stream
);
AZ
(
wrk
->
do_stream
);
AZ
(
wrk
->
do_gzip
);
AZ
(
wrk
->
do_gunzip
);
AZ
(
wrk
->
do_esi
);
#define ACCT(foo) AZ(wrk->acct_tmp.foo);
#define ACCT(foo) AZ(wrk->acct_tmp.foo);
#include "tbl/acct_fields.h"
#include "tbl/acct_fields.h"
#undef ACCT
#undef ACCT
...
...
bin/varnishd/cache/cache_esi_deliver.c
View file @
22c90f14
...
@@ -91,9 +91,6 @@ ved_include(struct sess *sp, const char *src, const char *host)
...
@@ -91,9 +91,6 @@ ved_include(struct sess *sp, const char *src, const char *host)
/* Client content already taken care of */
/* Client content already taken care of */
http_Unset
(
sp
->
http
,
H_Content_Length
);
http_Unset
(
sp
->
http
,
H_Content_Length
);
sp
->
wrk
->
do_esi
=
0
;
sp
->
wrk
->
do_gzip
=
0
;
sp
->
wrk
->
do_gunzip
=
0
;
sp
->
wrk
->
do_stream
=
0
;
sp
->
wrk
->
do_stream
=
0
;
sxid
=
sp
->
xid
;
sxid
=
sp
->
xid
;
...
...
bin/varnishd/cache/cache_esi_fetch.c
View file @
22c90f14
...
@@ -304,10 +304,10 @@ vfp_esi_begin(struct worker *w, size_t estimate)
...
@@ -304,10 +304,10 @@ vfp_esi_begin(struct worker *w, size_t estimate)
CHECK_OBJ_NOTNULL
(
w
->
busyobj
,
BUSYOBJ_MAGIC
);
CHECK_OBJ_NOTNULL
(
w
->
busyobj
,
BUSYOBJ_MAGIC
);
AZ
(
w
->
busyobj
->
vgz_rx
);
AZ
(
w
->
busyobj
->
vgz_rx
);
if
(
w
->
busyobj
->
is_gzip
&&
w
->
do_gunzip
)
{
if
(
w
->
busyobj
->
is_gzip
&&
w
->
busyobj
->
do_gunzip
)
{
w
->
busyobj
->
vgz_rx
=
VGZ_NewUngzip
(
w
,
"U F E"
);
w
->
busyobj
->
vgz_rx
=
VGZ_NewUngzip
(
w
,
"U F E"
);
VEP_Init
(
w
,
NULL
);
VEP_Init
(
w
,
NULL
);
}
else
if
(
w
->
busyobj
->
is_gunzip
&&
w
->
do_gzip
)
{
}
else
if
(
w
->
busyobj
->
is_gunzip
&&
w
->
busyobj
->
do_gzip
)
{
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
AN
(
vef
);
AN
(
vef
);
vef
->
vgz
=
VGZ_NewGzip
(
w
,
"G F E"
);
vef
->
vgz
=
VGZ_NewGzip
(
w
,
"G F E"
);
...
@@ -340,9 +340,9 @@ vfp_esi_bytes(struct worker *w, struct http_conn *htc, ssize_t bytes)
...
@@ -340,9 +340,9 @@ vfp_esi_bytes(struct worker *w, struct http_conn *htc, ssize_t bytes)
AZ
(
w
->
busyobj
->
fetch_failed
);
AZ
(
w
->
busyobj
->
fetch_failed
);
AN
(
w
->
busyobj
->
vep
);
AN
(
w
->
busyobj
->
vep
);
assert
(
&
w
->
busyobj
->
htc
==
htc
);
assert
(
&
w
->
busyobj
->
htc
==
htc
);
if
(
w
->
busyobj
->
is_gzip
&&
w
->
do_gunzip
)
if
(
w
->
busyobj
->
is_gzip
&&
w
->
busyobj
->
do_gunzip
)
i
=
vfp_esi_bytes_gu
(
w
,
htc
,
bytes
);
i
=
vfp_esi_bytes_gu
(
w
,
htc
,
bytes
);
else
if
(
w
->
busyobj
->
is_gunzip
&&
w
->
do_gzip
)
else
if
(
w
->
busyobj
->
is_gunzip
&&
w
->
busyobj
->
do_gzip
)
i
=
vfp_esi_bytes_ug
(
w
,
htc
,
bytes
);
i
=
vfp_esi_bytes_ug
(
w
,
htc
,
bytes
);
else
if
(
w
->
busyobj
->
is_gzip
)
else
if
(
w
->
busyobj
->
is_gzip
)
i
=
vfp_esi_bytes_gg
(
w
,
htc
,
bytes
);
i
=
vfp_esi_bytes_gg
(
w
,
htc
,
bytes
);
...
...
bin/varnishd/cache/cache_panic.c
View file @
22c90f14
...
@@ -213,6 +213,9 @@ pan_busyobj(const struct busyobj *bo)
...
@@ -213,6 +213,9 @@ pan_busyobj(const struct busyobj *bo)
VSB_printf
(
pan_vsp
,
" busyobj = %p {
\n
"
,
bo
);
VSB_printf
(
pan_vsp
,
" busyobj = %p {
\n
"
,
bo
);
if
(
bo
->
is_gzip
)
VSB_printf
(
pan_vsp
,
" is_gzip
\n
"
);
if
(
bo
->
is_gzip
)
VSB_printf
(
pan_vsp
,
" is_gzip
\n
"
);
if
(
bo
->
is_gunzip
)
VSB_printf
(
pan_vsp
,
" is_gunzip
\n
"
);
if
(
bo
->
is_gunzip
)
VSB_printf
(
pan_vsp
,
" is_gunzip
\n
"
);
if
(
bo
->
do_gzip
)
VSB_printf
(
pan_vsp
,
" do_gzip
\n
"
);
if
(
bo
->
do_gunzip
)
VSB_printf
(
pan_vsp
,
" do_gunzip
\n
"
);
if
(
bo
->
do_esi
)
VSB_printf
(
pan_vsp
,
" do_esi
\n
"
);
VSB_printf
(
pan_vsp
,
" bodystatus = %d,
\n
"
,
bo
->
body_status
);
VSB_printf
(
pan_vsp
,
" bodystatus = %d,
\n
"
,
bo
->
body_status
);
VSB_printf
(
pan_vsp
,
" },
\n
"
);
VSB_printf
(
pan_vsp
,
" },
\n
"
);
}
}
...
@@ -256,9 +259,6 @@ pan_sess(const struct sess *sp)
...
@@ -256,9 +259,6 @@ pan_sess(const struct sess *sp)
VSB_printf
(
pan_vsp
,
" flags = "
);
VSB_printf
(
pan_vsp
,
" flags = "
);
if
(
sp
->
wrk
->
do_stream
)
VSB_printf
(
pan_vsp
,
" do_stream"
);
if
(
sp
->
wrk
->
do_stream
)
VSB_printf
(
pan_vsp
,
" do_stream"
);
if
(
sp
->
wrk
->
do_gzip
)
VSB_printf
(
pan_vsp
,
" do_gzip"
);
if
(
sp
->
wrk
->
do_gunzip
)
VSB_printf
(
pan_vsp
,
" do_gunzip"
);
if
(
sp
->
wrk
->
do_esi
)
VSB_printf
(
pan_vsp
,
" do_esi"
);
if
(
sp
->
wrk
->
do_close
)
VSB_printf
(
pan_vsp
,
" do_close"
);
if
(
sp
->
wrk
->
do_close
)
VSB_printf
(
pan_vsp
,
" do_close"
);
VSB_printf
(
pan_vsp
,
"
\n
"
);
VSB_printf
(
pan_vsp
,
"
\n
"
);
pan_busyobj
(
sp
->
wrk
->
busyobj
);
pan_busyobj
(
sp
->
wrk
->
busyobj
);
...
...
bin/varnishd/cache/cache_vrt_var.c
View file @
22c90f14
...
@@ -194,9 +194,9 @@ VRT_r_##dir##_##onm(const struct sess *sp) \
...
@@ -194,9 +194,9 @@ VRT_r_##dir##_##onm(const struct sess *sp) \
return (sp->wrk->field); \
return (sp->wrk->field); \
}
}
VBERESP
(
beresp
,
unsigned
,
do_esi
,
do_esi
)
VBERESP
(
beresp
,
unsigned
,
do_esi
,
busyobj
->
do_esi
)
VBERESP
(
beresp
,
unsigned
,
do_gzip
,
do_gzip
)
VBERESP
(
beresp
,
unsigned
,
do_gzip
,
busyobj
->
do_gzip
)
VBERESP
(
beresp
,
unsigned
,
do_gunzip
,
do_gunzip
)
VBERESP
(
beresp
,
unsigned
,
do_gunzip
,
busyobj
->
do_gunzip
)
VBERESP
(
beresp
,
unsigned
,
do_stream
,
do_stream
)
VBERESP
(
beresp
,
unsigned
,
do_stream
,
do_stream
)
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
...
...
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