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
9f742a0a
Commit
9f742a0a
authored
Apr 17, 2018
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let VPF's handle their own 206 policy.
parent
44ed24b6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
15 deletions
+18
-15
cache_esi_fetch.c
bin/varnishd/cache/cache_esi_fetch.c
+10
-0
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+0
-14
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+7
-0
cache_main.c
bin/varnishd/cache/cache_main.c
+1
-1
No files found.
bin/varnishd/cache/cache_esi_fetch.c
View file @
9f742a0a
...
...
@@ -153,6 +153,11 @@ vfp_esi_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vc
->
req
,
HTTP_MAGIC
);
CHECK_OBJ_NOTNULL
(
vfe
,
VFP_ENTRY_MAGIC
);
if
(
http_GetStatus
(
vc
->
resp
)
==
206
)
{
VSLb
(
vc
->
wrk
->
vsl
,
SLT_VCL_Error
,
"Attempted ESI on partial (206) response"
);
return
(
VFP_ERROR
);
}
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
if
(
vef
==
NULL
)
return
(
VFP_ERROR
);
...
...
@@ -227,6 +232,11 @@ vfp_esi_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vc
->
req
,
HTTP_MAGIC
);
if
(
http_GetStatus
(
vc
->
resp
)
==
206
)
{
VSLb
(
vc
->
wrk
->
vsl
,
SLT_VCL_Error
,
"Attempted ESI on partial (206) response"
);
return
(
VFP_ERROR
);
}
ALLOC_OBJ
(
vef
,
VEF_MAGIC
);
if
(
vef
==
NULL
)
return
(
VFP_ERROR
);
...
...
bin/varnishd/cache/cache_fetch.c
View file @
9f742a0a
...
...
@@ -516,22 +516,8 @@ vbf_figure_out_vfp(struct busyobj *bo)
* no Content-Encoding --> object is not gzip'ed.
* anything else --> do nothing wrt gzip
*
* On partial responses (206 on pass), we fail if do_esi is
* requested because it could leak partial esi-directives, and
* ignore gzipery, because it makes no sense.
*
*/
if
(
http_GetStatus
(
bo
->
beresp
)
==
206
)
{
if
(
bo
->
do_esi
)
{
VSLb
(
bo
->
vsl
,
SLT_VCL_Error
,
"beresp.do_esi on partial response"
);
return
(
-
1
);
}
bo
->
do_gzip
=
bo
->
do_gunzip
=
0
;
return
(
0
);
}
/* No body -> done */
if
(
bo
->
htc
->
body_status
==
BS_NONE
||
bo
->
htc
->
content_length
==
0
)
{
...
...
bin/varnishd/cache/cache_gzip.c
View file @
9f742a0a
...
...
@@ -442,6 +442,13 @@ vfp_gzip_init(struct vfp_ctx *vc, struct vfp_entry *vfe)
CHECK_OBJ_NOTNULL
(
vc
,
VFP_CTX_MAGIC
);
CHECK_OBJ_NOTNULL
(
vfe
,
VFP_ENTRY_MAGIC
);
/*
* G(un)zip makes no sence on partial responses, but since
* it is an pure 1:1 transform, we can just ignore it.
*/
if
(
http_GetStatus
(
vc
->
resp
)
==
206
)
return
(
VFP_NULL
);
if
(
vfe
->
vfp
==
&
VFP_gzip
)
{
if
(
http_GetHdr
(
vc
->
resp
,
H_Content_Encoding
,
NULL
))
return
(
VFP_NULL
);
...
...
bin/varnishd/cache/cache_main.c
View file @
9f742a0a
...
...
@@ -102,7 +102,7 @@ THR_SetName(const char *name)
AZ
(
pthread_setspecific
(
name_key
,
name
));
#if defined(HAVE_PTHREAD_SET_NAME_NP)
(
void
)
pthread_set_name_np
(
pthread_self
(),
name
);
pthread_set_name_np
(
pthread_self
(),
name
);
#elif defined(HAVE_PTHREAD_SETNAME_NP)
#if defined(__APPLE__)
(
void
)
pthread_setname_np
(
name
);
...
...
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