fix(http1): reduce closed connections when body is dropped
If a user makes use of `Body::is_end_stream` to optimize so as to not need to do make a final poll just to receive `None`, previously the connection would not have progressed its reading state to a finished body, and so the connection would be closed. Now, upon reading any chunk, the connection state will check if it can know that the body would be finished, and progresses to a body finished state sooner. The integration tests were amplified by adding a naive hyper proxy as a secondary test, which happens to make use of that optimization, and thus caught the issue.
This commit is contained in:
@@ -62,6 +62,50 @@ t! {
|
||||
;
|
||||
}
|
||||
|
||||
t! {
|
||||
get_body_2_keeps_alive,
|
||||
client:
|
||||
request:
|
||||
uri: "/",
|
||||
;
|
||||
response:
|
||||
status: 200,
|
||||
headers: {
|
||||
"content-length" => 11,
|
||||
},
|
||||
body: "hello world",
|
||||
;
|
||||
request:
|
||||
uri: "/",
|
||||
;
|
||||
response:
|
||||
status: 200,
|
||||
headers: {
|
||||
"content-length" => 11,
|
||||
},
|
||||
body: "hello world",
|
||||
;
|
||||
server:
|
||||
request:
|
||||
uri: "/",
|
||||
;
|
||||
response:
|
||||
headers: {
|
||||
"content-length" => 11,
|
||||
},
|
||||
body: "hello world",
|
||||
;
|
||||
request:
|
||||
uri: "/",
|
||||
;
|
||||
response:
|
||||
headers: {
|
||||
"content-length" => 11,
|
||||
},
|
||||
body: "hello world",
|
||||
;
|
||||
}
|
||||
|
||||
t! {
|
||||
get_strip_connection_header,
|
||||
client:
|
||||
|
||||
Reference in New Issue
Block a user