mirror of
https://github.com/n0-computer/noq.git
synced 2026-09-24 03:58:19 +00:00
Fix spurious ZeroRttRejected on outgoing 0.5-RTT streams
This commit is contained in:
committed by
Dirkjan Ochtman
parent
a8f403bc9b
commit
15b8692dcf
@@ -89,12 +89,14 @@ pub enum Side {
|
||||
|
||||
impl Side {
|
||||
#[inline]
|
||||
fn is_client(self) -> bool {
|
||||
/// Shorthand for `self == Side::Client`
|
||||
pub fn is_client(self) -> bool {
|
||||
self == Side::Client
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn is_server(self) -> bool {
|
||||
/// Shorthand for `self == Side::Server`
|
||||
pub fn is_server(self) -> bool {
|
||||
self == Side::Server
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,7 +171,10 @@ impl Connection {
|
||||
{
|
||||
let mut conn = self.0.lock().unwrap();
|
||||
if let Some(x) = conn.inner.open(Directionality::Uni) {
|
||||
let _ = send.send(Ok((x, conn.inner.is_handshaking())));
|
||||
let _ = send.send(Ok((
|
||||
x,
|
||||
conn.inner.side().is_client() && conn.inner.is_handshaking(),
|
||||
)));
|
||||
} else {
|
||||
conn.uni_opening.push_back(send);
|
||||
// We don't notify the driver here because there's no way to ask the peer for more
|
||||
@@ -194,7 +197,10 @@ impl Connection {
|
||||
{
|
||||
let mut conn = self.0.lock().unwrap();
|
||||
if let Some(x) = conn.inner.open(Directionality::Bi) {
|
||||
let _ = send.send(Ok((x, conn.inner.is_handshaking())));
|
||||
let _ = send.send(Ok((
|
||||
x,
|
||||
conn.inner.side().is_client() && conn.inner.is_handshaking(),
|
||||
)));
|
||||
} else {
|
||||
conn.bi_opening.push_back(send);
|
||||
// We don't notify the driver here because there's no way to ask the peer for more
|
||||
|
||||
Reference in New Issue
Block a user