diff options
author | Yuchen Wu <[email protected]> | 2024-10-08 13:45:53 -0700 |
---|---|---|
committer | Edward Wang <[email protected]> | 2024-10-18 12:40:48 -0700 |
commit | 7419b1967e7686b00aefb7bcd2a4dfe59b31e639 (patch) | |
tree | f221e6a221dccbc53cfc1d0778c8b6a39d5793f8 | |
parent | 70b7d81ea82e7f9692451b29856a2a494e602323 (diff) | |
download | pingora-7419b1967e7686b00aefb7bcd2a4dfe59b31e639.tar.gz pingora-7419b1967e7686b00aefb7bcd2a4dfe59b31e639.zip |
Check the current advertised h2 max streams
This change fixes an issue that the actual current max send streams is
ignored.
This change requires h2 >= 0.4.6
-rw-r--r-- | .bleep | 2 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | pingora-core/src/connectors/http/v2.rs | 5 |
3 files changed, 6 insertions, 3 deletions
@@ -1 +1 @@ -4b2957a626c93fec5e24438cbbc0b506bbca25a6
\ No newline at end of file +ba954539761beee5e5d09b66c3a2957212aa499f @@ -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" diff --git a/pingora-core/src/connectors/http/v2.rs b/pingora-core/src/connectors/http/v2.rs index a1f295a..ad41f6b 100644 --- a/pingora-core/src/connectors/http/v2.rs +++ b/pingora-core/src/connectors/http/v2.rs @@ -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 { |