Fix spurious ZeroRttRejected on outgoing 0.5-RTT streams

This commit is contained in:
Benjamin Saunders
2019-04-30 06:23:44 -07:00
committed by Dirkjan Ochtman
parent a8f403bc9b
commit 15b8692dcf
2 changed files with 12 additions and 4 deletions
+4 -2
View File
@@ -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
}
}
+8 -2
View File
@@ -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