Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/proto/streams/recv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,16 @@ impl Recv {
}
}

// Received a frame, but no one cared about it. fix issue#648
if !stream.is_recv {
tracing::trace!(
"recv_data; frame ignored on stream release {:?} for some time",
stream.id,
);
self.release_connection_capacity(sz, &mut None);
return Ok(());
}

// Update stream level flow control
stream.recv_flow.send_data(sz);

Expand Down
4 changes: 4 additions & 0 deletions src/proto/streams/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ pub(super) struct Stream {
/// Frames pending for this stream to read
pub pending_recv: buffer::Deque,

/// When the RecvStream drop occurs, no data should be received.
pub is_recv: bool,

/// Task tracking receiving frames
pub recv_task: Option<Waker>,

Expand Down Expand Up @@ -180,6 +183,7 @@ impl Stream {
reset_at: None,
next_reset_expire: None,
pending_recv: buffer::Deque::new(),
is_recv: true,
recv_task: None,
pending_push_promises: store::Queue::new(),
content_length: ContentLength::Omitted,
Expand Down
3 changes: 2 additions & 1 deletion src/proto/streams/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1345,12 +1345,13 @@ impl OpaqueStreamRef {
.release_capacity(capacity, &mut stream, &mut me.actions.task)
}

/// Clear the receive queue and set the status to no longer receive data frames.
pub(crate) fn clear_recv_buffer(&mut self) {
let mut me = self.inner.lock().unwrap();
let me = &mut *me;

let mut stream = me.store.resolve(self.key);

stream.is_recv = false;
me.actions.recv.clear_recv_buffer(&mut stream);
}

Expand Down