Skip to content

Commit

Permalink
Check the current advertised h2 max streams
Browse files Browse the repository at this point in the history
This change fixes an issue that the actual current max send streams is
ignored.

This change requires h2 >= 0.4.6
  • Loading branch information
eaufavor authored and drcaramelsyrup committed Oct 18, 2024
1 parent 70b7d81 commit 7419b19
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .bleep
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4b2957a626c93fec5e24438cbbc0b506bbca25a6
ba954539761beee5e5d09b66c3a2957212aa499f
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ httparse = "1"
bytes = "1.0"
http = "1.0.0"
log = "0.4"
h2 = ">=0.4.4"
h2 = ">=0.4.6"
once_cell = "1"
lru = "0"
ahash = ">=0.8.9"
Expand Down
5 changes: 4 additions & 1 deletion pingora-core/src/connectors/http/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,12 @@ impl ConnectionRef {
release_lock: Arc::new(Mutex::new(())),
}))
}

pub fn more_streams_allowed(&self) -> bool {
let current = self.0.current_streams.load(Ordering::Relaxed);
!self.is_shutting_down()
&& self.0.max_streams > self.0.current_streams.load(Ordering::Relaxed)
&& self.0.max_streams > current
&& self.0.connection_stub.0.current_max_send_streams() > current
}

pub fn is_idle(&self) -> bool {
Expand Down

0 comments on commit 7419b19

Please sign in to comment.