refuse streams that would violate max concurrency settings.

improve ping control API
This commit is contained in:
Oliver Gould
2017-07-17 22:18:03 +00:00
parent fb4f0bc5af
commit 79d3aee1dc
9 changed files with 234 additions and 82 deletions

View File

@@ -296,16 +296,28 @@ pub struct StreamMap {
}
impl StreamMap {
pub fn get_mut(&mut self, id: &StreamId) -> Option<&mut StreamState> {
self.inner.get_mut(id)
pub fn get_mut(&mut self, id: StreamId) -> Option<&mut StreamState> {
self.inner.get_mut(&id)
}
pub fn has_stream(&mut self, id: StreamId) -> bool {
self.inner.contains_key(&id)
}
pub fn is_empty(&self) -> bool {
self.inner.is_empty()
}
pub fn len(&self) -> usize {
self.inner.len()
}
pub fn entry(&mut self, id: StreamId) -> Entry<StreamId, StreamState, BuildHasherDefault<FnvHasher>> {
self.inner.entry(id)
}
pub fn remove(&mut self, id: &StreamId) -> Option<StreamState> {
self.inner.remove(id)
pub fn remove(&mut self, id: StreamId) -> Option<StreamState> {
self.inner.remove(&id)
}
pub fn shrink_all_local_windows(&mut self, decr: u32) {