Make 'pending reset' streams not count towards active streams

This commit is contained in:
Sean McArthur
2019-03-12 14:39:48 -07:00
parent feff97905f
commit 492f4e7f11
7 changed files with 22 additions and 36 deletions

View File

@@ -375,17 +375,8 @@ fn send_reset_notifies_recv_stream() {
)
.send_frame(frames::headers(1).response(200))
.recv_frame(frames::reset(1).refused())
.recv_frame(
frames::headers(3)
.request("POST", "https://example.com/")
.eos()
)
.send_frame(
frames::headers(3)
.response(200)
.eos()
)
.close();
.recv_frame(frames::go_away(0))
.recv_eof();
let client = client::handshake(io)
.expect("handshake")
@@ -424,22 +415,10 @@ fn send_reset_notifies_recv_stream() {
unordered.push(Box::new(tx));
conn.drive(unordered.for_each(|_| Ok(())))
.map(move |(conn, _)| (client, conn))
})
.and_then(|(mut client, conn)| {
// send a second request just to keep the connection alive until
// we know the previous `RecvStream` was notified about the reset.
let request = Request::builder()
.method(Method::POST)
.uri("https://example.com/")
.body(())
.unwrap();
let (resp2, _) = client.send_request(request, true).unwrap();
let fut = resp2.map(|_res| ());
conn.drive(fut)
.and_then(|(conn, _)| conn.expect("client"))
.and_then(move |(conn, _)| {
drop(client); // now let client gracefully goaway
conn.expect("client")
})
});
client.join(srv).wait().expect("wait");

View File

@@ -198,7 +198,7 @@ fn pending_push_promises_reset_when_dropped() {
});
conn.drive(req)
.and_then(|(conn, _)| conn.expect("client"))
.and_then(move |(conn, _)| conn.expect("client").map(move |()| drop(client)))
});
client.join(srv).wait().expect("wait");

View File

@@ -513,7 +513,7 @@ fn send_rst_stream_allows_recv_data() {
conn.expect("client")
.drive(req)
.and_then(|(conn, _)| conn)
.and_then(move |(conn, _)| conn.map(move |()| drop(client)))
});
@@ -562,7 +562,7 @@ fn send_rst_stream_allows_recv_trailers() {
conn.expect("client")
.drive(req)
.and_then(|(conn, _)| conn)
.and_then(move |(conn, _)| conn.map(move |()| drop(client)))
});
@@ -709,7 +709,8 @@ fn rst_stream_max() {
conn.drive(req1.join(req2))
.and_then(|(conn, _)| conn.expect_err("client"))
.map(|err| {
.map(move |err| {
drop(client);
assert_eq!(
err.to_string(),
"protocol error: unspecific protocol error detected"
@@ -1127,9 +1128,9 @@ fn srv_window_update_on_lower_stream_id() {
h2.expect("client")
.drive(response)
.and_then(|(h2, _)| {
.and_then(move |(h2, _)| {
println!("RESPONSE DONE");
h2
h2.map(move |()| drop(client))
})
.then(|result| {
println!("WUT");