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
1b4a6b5e
Commit
1b4a6b5e
authored
Oct 02, 2013
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Spot and handle 3-digit status from backend, where the first digit is zero.
Fixes: #1337
parent
c0fc574a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
10 deletions
+37
-10
cache_http1_proto.c
bin/varnishd/cache/cache_http1_proto.c
+15
-10
r01337.vtc
bin/varnishtest/tests/r01337.vtc
+22
-0
No files found.
bin/varnishd/cache/cache_http1_proto.c
View file @
1b4a6b5e
...
...
@@ -461,7 +461,6 @@ HTTP1_DissectRequest(struct req *req)
uint16_t
HTTP1_DissectResponse
(
struct
http
*
hp
,
const
struct
http_conn
*
htc
)
{
int
j
;
uint16_t
retval
=
0
;
char
*
p
;
...
...
@@ -481,16 +480,22 @@ HTTP1_DissectResponse(struct http *hp, const struct http_conn *htc)
if
(
retval
==
0
)
{
hp
->
status
=
0
;
p
=
hp
->
hd
[
HTTP_HDR_STATUS
].
b
;
for
(
j
=
100
;
j
!=
0
;
j
/=
10
)
{
if
(
!
vct_isdigit
(
*
p
))
{
retval
=
503
;
break
;
}
hp
->
status
+=
(
uint16_t
)(
j
*
(
*
p
-
'0'
));
p
++
;
}
if
(
*
p
!=
'\0'
)
if
(
p
[
0
]
<
'1'
||
p
[
0
]
>
'9'
)
retval
=
503
;
else
hp
->
status
+=
100
*
(
p
[
0
]
-
'0'
);
if
(
p
[
1
]
<
'0'
||
p
[
1
]
>
'9'
)
retval
=
503
;
else
hp
->
status
+=
10
*
(
p
[
1
]
-
'0'
);
if
(
p
[
2
]
<
'0'
||
p
[
2
]
>
'9'
)
retval
=
503
;
else
hp
->
status
+=
(
p
[
2
]
-
'0'
);
assert
(
hp
->
status
<=
999
);
}
if
(
retval
!=
0
)
{
...
...
bin/varnishtest/tests/r01337.vtc
0 → 100644
View file @
1b4a6b5e
varnishtest "Bogus backend status"
server s1 {
rxreq
expect req.url == /low
txresp -status 099
accept
rxreq
expect req.url == /high
txresp -status 1000
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -url /low
rxresp
expect resp.status == 503
txreq -url /high
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