Skip to content

Commit 7419b19

Browse files
eaufavordrcaramelsyrup
authored andcommitted
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
1 parent 70b7d81 commit 7419b19

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

.bleep

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4b2957a626c93fec5e24438cbbc0b506bbca25a6
1+
ba954539761beee5e5d09b66c3a2957212aa499f

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ httparse = "1"
2929
bytes = "1.0"
3030
http = "1.0.0"
3131
log = "0.4"
32-
h2 = ">=0.4.4"
32+
h2 = ">=0.4.6"
3333
once_cell = "1"
3434
lru = "0"
3535
ahash = ">=0.8.9"

pingora-core/src/connectors/http/v2.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ impl ConnectionRef {
8585
release_lock: Arc::new(Mutex::new(())),
8686
}))
8787
}
88+
8889
pub fn more_streams_allowed(&self) -> bool {
90+
let current = self.0.current_streams.load(Ordering::Relaxed);
8991
!self.is_shutting_down()
90-
&& self.0.max_streams > self.0.current_streams.load(Ordering::Relaxed)
92+
&& self.0.max_streams > current
93+
&& self.0.connection_stub.0.current_max_send_streams() > current
9194
}
9295

9396
pub fn is_idle(&self) -> bool {

0 commit comments

Comments
 (0)