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

@@ -173,7 +173,7 @@ where
pub fn maybe_close_connection_if_no_streams(&mut self) {
// If we poll() and realize that there are no streams or references
// then we can close the connection by transitioning to GOAWAY
if self.streams.num_active_streams() == 0 && !self.streams.has_streams_or_other_references() {
if !self.streams.has_streams_or_other_references() {
self.go_away_now(Reason::NO_ERROR);
}
}
@@ -202,7 +202,7 @@ where
try_ready!(self.streams.poll_complete(&mut self.codec));
if self.error.is_some() || self.go_away.should_close_on_idle() {
if self.streams.num_active_streams() == 0 {
if !self.streams.has_streams() {
self.go_away_now(Reason::NO_ERROR);
continue;
}