Skip to content

Commit 04e6398

Browse files
committed
fix: panicked when a reset stream would decrement twice
1 parent f126229 commit 04e6398

File tree

2 files changed

+6
-15
lines changed

2 files changed

+6
-15
lines changed

src/proto/streams/recv.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -859,15 +859,6 @@ impl Recv {
859859

860860
tracing::trace!("enqueue_reset_expiration; {:?}", stream.id);
861861

862-
if !counts.can_inc_num_reset_streams() {
863-
// try to evict 1 stream if possible
864-
// if max allow is 0, this won't be able to evict,
865-
// and then we'll just bail after
866-
if let Some(evicted) = self.pending_reset_expired.pop(stream.store_mut()) {
867-
counts.transition_after(evicted, true);
868-
}
869-
}
870-
871862
if counts.can_inc_num_reset_streams() {
872863
counts.inc_num_reset_streams();
873864
self.pending_reset_expired.push(stream);

tests/h2-tests/tests/stream_states.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -750,14 +750,14 @@ async fn rst_stream_max() {
750750
srv.recv_frame(frames::reset(1).cancel()).await;
751751
srv.recv_frame(frames::reset(3).cancel()).await;
752752
// sending frame after canceled!
753-
// newer streams trump older streams
754-
// 3 is still being ignored
755-
srv.send_frame(frames::data(3, vec![0; 16]).eos()).await;
753+
// olders streams trump newer streams
754+
// 1 is still being ignored
755+
srv.send_frame(frames::data(1, vec![0; 16]).eos()).await;
756756
// ping pong to be sure of no goaway
757757
srv.ping_pong([1; 8]).await;
758-
// 1 has been evicted, will get a reset
759-
srv.send_frame(frames::data(1, vec![0; 16]).eos()).await;
760-
srv.recv_frame(frames::reset(1).stream_closed()).await;
758+
// 3 has been evicted, will get a reset
759+
srv.send_frame(frames::data(3, vec![0; 16]).eos()).await;
760+
srv.recv_frame(frames::reset(3).stream_closed()).await;
761761
};
762762

763763
let client = async move {

0 commit comments

Comments
 (0)