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
41f7a356
Commit
41f7a356
authored
Nov 26, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix an oversight when we closed #942: The exact same condition
can happen if we gunzip on fetch.
parent
36e9a06f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
cache_gzip.c
bin/varnishd/cache/cache_gzip.c
+2
-0
r00942.vtc
bin/varnishtest/tests/r00942.vtc
+14
-3
No files found.
bin/varnishd/cache/cache_gzip.c
View file @
41f7a356
...
...
@@ -516,6 +516,8 @@ vfp_gunzip_bytes(struct busyobj *bo, struct http_conn *htc, ssize_t bytes)
i
=
VGZ_Gunzip
(
vg
,
&
dp
,
&
dl
);
if
(
i
!=
VGZ_OK
&&
i
!=
VGZ_END
)
return
(
VFP_Error
(
bo
,
"Gunzip data error"
));
if
(
i
==
VGZ_END
&&
!
VGZ_IbufEmpty
(
vg
))
return
(
VFP_Error
(
bo
,
"Junk after gzip data"
));
VBO_extend
(
bo
,
dl
);
}
assert
(
i
==
Z_OK
||
i
==
Z_STREAM_END
);
...
...
bin/varnishtest/tests/r00942.vtc
View file @
41f7a356
varnishtest "#942 junk after gzip from backend"
server s1 {
server s1
-repeat 2
{
rxreq
txresp -nolen \
-hdr "Content-Encoding: gzip" \
-hdr "Connection: close" \
-hdr "Transfer-Encoding: Chunked"
send "14\r\n"
# An empty gzip file:
...
...
@@ -21,13 +22,17 @@ server s1 {
chunked "FOOBAR"
chunkedlen 0
expect_close
accept
} -start
varnish v1 \
-vcl+backend {
sub vcl_backend_response {
set beresp.do_stream = false;
if (bereq.http.foo == "foo") {
set beresp.do_gunzip = true;
}
}
}
...
...
@@ -35,7 +40,13 @@ varnish v1 -cliok "param.set debug +syncvsl"
varnish v1 -start
client c1 {
txreq
txreq -url /1
rxresp
expect resp.status == 503
} -run
client c1 {
txreq -url /2 -hdr "Foo: foo"
rxresp
expect resp.status == 503
} -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