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
61a66b7b
Commit
61a66b7b
authored
May 05, 2016
by
Federico G. Schwindt
Committed by
Pål Hermunn Johansen
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly handle EOF responses with HTTP/1.1
Fixes #1918.
parent
748725ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
4 deletions
+26
-4
cache_http1_proto.c
bin/varnishd/http1/cache_http1_proto.c
+4
-4
r01918.vtc
bin/varnishtest/tests/r01918.vtc
+22
-0
No files found.
bin/varnishd/http1/cache_http1_proto.c
View file @
61a66b7b
...
...
@@ -277,7 +277,7 @@ http1_splitline(struct http *hp, struct http_conn *htc, const int *hf)
/*--------------------------------------------------------------------*/
static
enum
body_status
http1_body_status
(
const
struct
http
*
hp
,
struct
http_conn
*
htc
)
http1_body_status
(
const
struct
http
*
hp
,
struct
http_conn
*
htc
,
int
request
)
{
ssize_t
cl
;
const
char
*
b
;
...
...
@@ -307,7 +307,7 @@ http1_body_status(const struct http *hp, struct http_conn *htc)
return
(
cl
==
0
?
BS_NONE
:
BS_LENGTH
);
}
if
(
hp
->
protover
==
11
)
if
(
hp
->
protover
==
11
&&
(
request
||
!
http_HdrIs
(
hp
,
H_Connection
,
"close"
))
)
return
(
BS_NONE
);
if
(
http_HdrIs
(
hp
,
H_Connection
,
"keep-alive"
))
{
...
...
@@ -378,7 +378,7 @@ HTTP1_DissectRequest(struct http_conn *htc, struct http *hp)
}
}
htc
->
body_status
=
http1_body_status
(
hp
,
htc
);
htc
->
body_status
=
http1_body_status
(
hp
,
htc
,
1
);
if
(
htc
->
body_status
==
BS_ERROR
)
return
(
400
);
...
...
@@ -456,7 +456,7 @@ HTTP1_DissectResponse(struct http_conn *htc, struct http *hp,
!
Tlen
(
hp
->
hd
[
HTTP_HDR_REASON
]))
http_SetH
(
hp
,
HTTP_HDR_REASON
,
http_Status2Reason
(
hp
->
status
));
htc
->
body_status
=
http1_body_status
(
hp
,
htc
);
htc
->
body_status
=
http1_body_status
(
hp
,
htc
,
0
);
return
(
retval
);
}
...
...
bin/varnishtest/tests/r01918.vtc
0 → 100644
View file @
61a66b7b
varnishtest "Check EOF responses work with HTTP/1.1"
server s1 {
rxreq
txresp -nolen -bodylen 10
rxreq
txresp -hdr "Connection: close" -nolen -bodylen 10
} -start
varnish v1 -vcl+backend {
} -start
client c1 {
txreq -url /1
rxresp
expect resp.status == 200
expect resp.bodylen == 0
txreq -url /2
rxresp
expect resp.status == 200
expect resp.bodylen == 10
} -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