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
9ec14234
Commit
9ec14234
authored
Dec 14, 2022
by
Gil Pedersen
Committed by
Poul-Henning Kamp
Jan 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't error on short range response
parent
7da66c9b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
9 deletions
+21
-9
cache_range.c
bin/varnishd/cache/cache_range.c
+2
-1
r01506.vtc
bin/varnishtest/tests/r01506.vtc
+11
-8
r02258.vtc
bin/varnishtest/tests/r02258.vtc
+8
-0
No files found.
bin/varnishd/cache/cache_range.c
View file @
9ec14234
...
...
@@ -55,7 +55,8 @@ vrg_range_fini(struct vdp_ctx *vdc, void **priv)
CHECK_OBJ_NOTNULL
(
vdc
,
VDP_CTX_MAGIC
);
CAST_OBJ_NOTNULL
(
vrg_priv
,
*
priv
,
VRG_PRIV_MAGIC
);
if
(
vrg_priv
->
range_off
<
vrg_priv
->
range_high
)
{
if
(
vrg_priv
->
req
->
resp_len
>=
0
&&
vrg_priv
->
range_off
<
vrg_priv
->
range_high
)
{
Req_Fail
(
vrg_priv
->
req
,
SC_RANGE_SHORT
);
vrg_priv
->
req
->
vdc
->
retval
=
-
1
;
}
...
...
bin/varnishtest/tests/r01506.vtc
View file @
9ec14234
...
...
@@ -2,7 +2,7 @@ varnishtest "range requests on streamed response"
barrier b1 cond 2 -cyclic
server s1 -repeat
4
{
server s1 -repeat
5
{
rxreq
txresp -nolen \
-hdr "Transfer-Encoding: chunked" \
...
...
@@ -24,11 +24,6 @@ varnish v1 -vcl+backend {} -start
varnish v1 -cliok "param.set debug +syncvsl"
logexpect l1 -v v1 -g session {
expect 0 1000 Begin sess
expect * = SessClose RANGE_SHORT
} -start
client c1 {
txreq -url /1 -hdr "Range: bytes=17-101"
rxresphdrs
...
...
@@ -65,7 +60,15 @@ client c1 {
barrier b1 sync
rxrespbody
expect resp.bodylen == 34
delay .1
# Keeps working after short response
txreq -url /5 -hdr "Range: bytes=17-101"
rxresphdrs
expect resp.status == 206
barrier b1 sync
rxrespbody
expect resp.bodylen == 85
} -run
varnish v1 -expect sc_range_short == 1
logexpect l1 -wait
varnish v1 -expect sc_range_short == 0
bin/varnishtest/tests/r02258.vtc
View file @
9ec14234
...
...
@@ -14,6 +14,11 @@ server s1 {
varnish v1 -vcl+backend { } -start
logexpect l1 -v v1 -g session {
expect 0 1000 Begin sess
expect * = SessClose RANGE_SHORT
} -start
client c1 {
txreq -hdr "range: bytes=0-16"
rxresp -no_obj
...
...
@@ -24,6 +29,7 @@ client c1 {
} -run
varnish v1 -expect MAIN.sc_range_short == 1
logexpect l1 -wait
delay .3
...
...
@@ -43,3 +49,5 @@ client c2 {
expect rst.err == INTERNAL_ERROR
} -run
} -run
varnish v1 -expect MAIN.sc_range_short == 1
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