Skip to content

Commit

Permalink
session: fix handling passed writes to the inner protocols
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed May 5, 2024
1 parent 1dae423 commit 1805ced
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,19 @@ where S::Artifact: IntoInit<M::Init>
log::trace!(target: M::NAME, "Sending handshake act on write: {act:02x?}");

self.session.write_all(&act)?;
}
} else {
#[cfg(feature = "log")]
log::trace!(target: M::NAME, "Handshake complete, passing data to inner session");

return Err(io::ErrorKind::Interrupted.into());
return self.session.write(buf);
}
}

self.session.write(buf)
if buf.is_empty() {
Ok(0)
} else {
Err(io::ErrorKind::Interrupted.into())
}
}

fn flush(&mut self) -> io::Result<()> { self.session.flush() }
Expand Down

0 comments on commit 1805ced

Please sign in to comment.