aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYuchen Wu <[email protected]>2024-10-08 13:45:53 -0700
committerEdward Wang <[email protected]>2024-10-18 12:40:48 -0700
commit7419b1967e7686b00aefb7bcd2a4dfe59b31e639 (patch)
treef221e6a221dccbc53cfc1d0778c8b6a39d5793f8
parent70b7d81ea82e7f9692451b29856a2a494e602323 (diff)
downloadpingora-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--.bleep2
-rw-r--r--Cargo.toml2
-rw-r--r--pingora-core/src/connectors/http/v2.rs5
3 files changed, 6 insertions, 3 deletions
diff --git a/.bleep b/.bleep
index c142fa0..045b30f 100644
--- a/.bleep
+++ b/.bleep
@@ -1 +1 @@
-4b2957a626c93fec5e24438cbbc0b506bbca25a6 \ No newline at end of file
+ba954539761beee5e5d09b66c3a2957212aa499f
diff --git a/Cargo.toml b/Cargo.toml
index f50a2f5..1ec85f8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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 {