Ref count stream state and release when final (#73)
Previously, stream state was never released so that long-lived connections leaked memory. Now, stream states are reference-counted and freed from the stream slab when complete. Locally reset streams are retained so that received frames may be ignored.
This commit is contained in:
committed by
Oliver Gould
parent
daa54b9512
commit
5c0efcf8c4
@@ -253,3 +253,18 @@ impl<T, B> Connection<T, server::Peer, B>
|
||||
self.streams.next_incoming()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
impl<T, P, B> Connection<T, P, B>
|
||||
where T: AsyncRead + AsyncWrite,
|
||||
P: Peer,
|
||||
B: IntoBuf,
|
||||
{
|
||||
pub fn num_active_streams(&self) -> usize {
|
||||
self.streams.num_active_streams()
|
||||
}
|
||||
|
||||
pub fn num_wired_streams(&self) -> usize {
|
||||
self.streams.num_wired_streams()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user