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
322bcca6
Commit
322bcca6
authored
Apr 17, 2018
by
Poul-Henning Kamp
Committed by
Dridi Boukelmoune
Jun 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the individual VFP->init()'s responsible for the objflags.
parent
ad9aab0b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
20 deletions
+23
-20
cache_esi_fetch.c
bin/varnishd/cache/cache_esi_fetch.c
+2
-0
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+13
-16
cache_filter.h
bin/varnishd/cache/cache_filter.h
+1
-0
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+7
-2
bo_flags.h
include/tbl/bo_flags.h
+0
-2
No files found.
bin/varnishd/cache/cache_esi_fetch.c
View file @
322bcca6
...
...
@@ -156,6 +156,7 @@ vfp_esi_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
if
(
vef
==
NULL
)
return
(
VFP_ERROR
);
vc
->
obj_flags
|=
OF_GZIPED
|
OF_CHGGZIP
|
OF_ESIPROC
;
vef
->
vgz
=
VGZ_NewGzip
(
vc
->
wrk
->
vsl
,
"G F E"
);
vef
->
vep
=
VEP_Init
(
vc
,
vc
->
req
,
vfp_vep_callback
,
vef
);
vef
->
ibuf_sz
=
cache_param
->
gzip_buffer
;
...
...
@@ -229,6 +230,7 @@ vfp_esi_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
if
(
vef
==
NULL
)
return
(
VFP_ERROR
);
vc
->
obj_flags
|=
OF_ESIPROC
;
vef
->
vep
=
VEP_Init
(
vc
,
vc
->
req
,
NULL
,
NULL
);
vfe
->
priv1
=
vef
;
return
(
VFP_OK
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
322bcca6
...
...
@@ -503,6 +503,7 @@ vbf_stp_fetchbody(struct worker *wrk, struct busyobj *bo)
static
int
vbf_figure_out_vfp
(
struct
busyobj
*
bo
)
{
int
is_gzip
,
is_gunzip
;
/*
* The VCL variables beresp.do_g[un]zip tells us how we want the
...
...
@@ -543,26 +544,26 @@ vbf_figure_out_vfp(struct busyobj *bo)
if
(
!
cache_param
->
http_gzip_support
)
bo
->
do_gzip
=
bo
->
do_gunzip
=
0
;
bo
->
is_gzip
=
http_HdrIs
(
bo
->
beresp
,
H_Content_Encoding
,
"gzip"
);
bo
->
is_gunzip
=
!
http_GetHdr
(
bo
->
beresp
,
H_Content_Encoding
,
NULL
);
assert
(
bo
->
is_gzip
==
0
||
bo
->
is_gunzip
==
0
);
is_gzip
=
http_HdrIs
(
bo
->
beresp
,
H_Content_Encoding
,
"gzip"
);
is_gunzip
=
!
http_GetHdr
(
bo
->
beresp
,
H_Content_Encoding
,
NULL
);
assert
(
is_gzip
==
0
||
is_gunzip
==
0
);
/* We won't gunzip unless it is gzip'ed */
if
(
bo
->
do_gunzip
&&
!
bo
->
is_gzip
)
if
(
bo
->
do_gunzip
&&
!
is_gzip
)
bo
->
do_gunzip
=
0
;
/* We wont gzip unless if it already is gzip'ed */
if
(
bo
->
do_gzip
&&
!
bo
->
is_gunzip
)
if
(
bo
->
do_gzip
&&
!
is_gunzip
)
bo
->
do_gzip
=
0
;
/* But we can't do both at the same time */
assert
(
bo
->
do_gzip
==
0
||
bo
->
do_gunzip
==
0
);
if
(
bo
->
do_gunzip
||
(
bo
->
is_gzip
&&
bo
->
do_esi
))
if
(
bo
->
do_gunzip
||
(
is_gzip
&&
bo
->
do_esi
))
if
(
VFP_Push
(
bo
->
vfc
,
&
VFP_gunzip
)
==
NULL
)
return
(
-
1
);
if
(
bo
->
do_esi
&&
(
bo
->
do_gzip
||
(
bo
->
is_gzip
&&
!
bo
->
do_gunzip
)))
if
(
bo
->
do_esi
&&
(
bo
->
do_gzip
||
(
is_gzip
&&
!
bo
->
do_gunzip
)))
return
(
VFP_Push
(
bo
->
vfc
,
&
VFP_esi_gzip
)
==
NULL
?
-
1
:
0
);
if
(
bo
->
do_esi
)
...
...
@@ -571,7 +572,7 @@ vbf_figure_out_vfp(struct busyobj *bo)
if
(
bo
->
do_gzip
)
return
(
VFP_Push
(
bo
->
vfc
,
&
VFP_gzip
)
==
NULL
?
-
1
:
0
);
if
(
bo
->
is_gzip
&&
!
bo
->
do_gunzip
)
if
(
is_gzip
&&
!
bo
->
do_gunzip
)
return
(
VFP_Push
(
bo
->
vfc
,
&
VFP_testgunzip
)
==
NULL
?
-
1
:
0
);
return
(
0
);
...
...
@@ -614,14 +615,10 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
return
(
F_STP_ERROR
);
}
if
(
bo
->
do_esi
)
ObjSetFlag
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OF_ESIPROC
,
1
);
if
(
bo
->
do_gzip
||
(
bo
->
is_gzip
&&
!
bo
->
do_gunzip
))
ObjSetFlag
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OF_GZIPED
,
1
);
if
(
bo
->
do_gzip
||
bo
->
do_gunzip
)
ObjSetFlag
(
bo
->
wrk
,
bo
->
fetch_objcore
,
OF_CHGGZIP
,
1
);
#define OBJ_FLAG(U, l, v) \
if (bo->vfc->obj_flags & OF_##U) \
ObjSetFlag(bo->wrk, bo->fetch_objcore, OF_##U, 1);
#include "tbl/obj_attr.h"
if
(
!
(
bo
->
fetch_objcore
->
flags
&
OC_F_PASS
)
&&
http_IsStatus
(
bo
->
beresp
,
200
)
&&
(
...
...
bin/varnishd/cache/cache_filter.h
View file @
322bcca6
...
...
@@ -82,6 +82,7 @@ struct vfp_ctx {
struct
vfp_entry_s
vfp
;
struct
vfp_entry
*
vfp_nxt
;
unsigned
obj_flags
;
};
enum
vfp_status
VFP_Suck
(
struct
vfp_ctx
*
,
void
*
p
,
ssize_t
*
lp
);
...
...
bin/varnishd/cache/cache_gzip.c
View file @
322bcca6
...
...
@@ -446,13 +446,18 @@ vfp_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
if
(
http_GetHdr
(
vc
->
resp
,
H_Content_Encoding
,
NULL
))
return
(
VFP_NULL
);
vg
=
VGZ_NewGzip
(
vc
->
wrk
->
vsl
,
vfe
->
vfp
->
priv1
);
vc
->
obj_flags
|=
OF_GZIPED
|
OF_CHGGZIP
;
}
else
{
if
(
!
http_HdrIs
(
vc
->
resp
,
H_Content_Encoding
,
"gzip"
))
return
(
VFP_NULL
);
if
(
vfe
->
vfp
==
&
VFP_gunzip
)
if
(
vfe
->
vfp
==
&
VFP_gunzip
)
{
vg
=
VGZ_NewGunzip
(
vc
->
wrk
->
vsl
,
vfe
->
vfp
->
priv1
);
else
vc
->
obj_flags
&=
~
OF_GZIPED
;
vc
->
obj_flags
|=
OF_CHGGZIP
;
}
else
{
vg
=
VGZ_NewTestGunzip
(
vc
->
wrk
->
vsl
,
vfe
->
vfp
->
priv1
);
vc
->
obj_flags
|=
OF_GZIPED
;
}
}
if
(
vg
==
NULL
)
return
(
VFP_ERROR
);
...
...
include/tbl/bo_flags.h
View file @
322bcca6
...
...
@@ -36,8 +36,6 @@ BO_FLAG(do_gunzip, 1, 1, "")
BO_FLAG
(
do_stream
,
1
,
1
,
""
)
BO_FLAG
(
do_pass
,
0
,
0
,
""
)
BO_FLAG
(
uncacheable
,
0
,
0
,
""
)
BO_FLAG
(
is_gzip
,
0
,
0
,
""
)
BO_FLAG
(
is_gunzip
,
0
,
0
,
""
)
BO_FLAG
(
was_304
,
1
,
0
,
""
)
BO_FLAG
(
is_bgfetch
,
0
,
0
,
""
)
#undef BO_FLAG
...
...
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