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
e6e34d24
Commit
e6e34d24
authored
Aug 17, 2011
by
Poul-Henning Kamp
Committed by
Tollef Fog Heen
Aug 17, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If the backend used chunked encoding and sent junk after the gzip
data, the thread would go into a spin. Fixes #942
parent
62cc4b33
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
cache_gzip.c
bin/varnishd/cache_gzip.c
+5
-1
r00942.vtc
bin/varnishtest/tests/r00942.vtc
+38
-0
No files found.
bin/varnishd/cache_gzip.c
View file @
e6e34d24
...
...
@@ -302,7 +302,7 @@ VGZ_Gunzip(struct vgz *vg, const void **pptr, size_t *plen)
return
(
VGZ_END
);
if
(
i
==
Z_BUF_ERROR
)
return
(
VGZ_STUCK
);
printf
(
"
INFLATE=%d (%s)
\n
"
,
i
,
vg
->
vz
.
msg
);
VSL
(
SLT_Debug
,
0
,
"Unknown
INFLATE=%d (%s)
\n
"
,
i
,
vg
->
vz
.
msg
);
return
(
VGZ_ERROR
);
}
...
...
@@ -629,6 +629,10 @@ vfp_testgzip_bytes(struct sess *sp, struct http_conn *htc, ssize_t bytes)
while
(
!
VGZ_IbufEmpty
(
vg
))
{
VGZ_Obuf
(
vg
,
obuf
,
sizeof
obuf
);
i
=
VGZ_Gunzip
(
vg
,
&
dp
,
&
dl
);
if
(
i
==
VGZ_END
&&
!
VGZ_IbufEmpty
(
vg
))
{
WSP
(
sp
,
SLT_FetchError
,
"Junk after gzip data"
);
return
(
-
1
);
}
if
(
i
!=
VGZ_OK
&&
i
!=
VGZ_END
)
{
WSP
(
sp
,
SLT_FetchError
,
"Invalid Gzip data: %s"
,
vg
->
vz
.
msg
);
...
...
bin/varnishtest/tests/r00942.vtc
0 → 100644
View file @
e6e34d24
varnishtest "#942 junk after gzip from backend"
server s1 {
rxreq
txresp -nolen \
-hdr "Content-Encoding: gzip" \
-hdr "Transfer-Encoding: Chunked"
send "14\r\n"
# An empty gzip file:
sendhex "1f8b"
sendhex "08"
sendhex "00"
sendhex "00000000"
sendhex "00"
sendhex "03"
sendhex "0300"
sendhex "00000000"
sendhex "00000000"
send "\r\n"
chunked "FOOBAR"
chunkedlen 0
} -start
varnish v1 \
-arg {-p diag_bitmap=0x00010000} \
-vcl+backend {}
varnish v1 -start
client c1 {
txreq
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