Skip to content

Commit

Permalink
Fix spurious ZeroRttRejected on outgoing 0.5-RTT streams
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith authored and djc committed Apr 30, 2019
1 parent a8f403b commit 15b8692
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 4 additions & 2 deletions quinn-proto/src/lib.rs
Expand Up @@ -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
}
}
Expand Down
10 changes: 8 additions & 2 deletions quinn/src/connection.rs
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 15b8692

Please sign in to comment.