mirror of
https://gitlab.redox-os.org/CoffeeCode/redox-ssh.git
synced 2025-12-28 15:22:18 +01:00
Flush stream after writing a packet
This commit is contained in:
parent
85203b1f61
commit
ba376a9add
2 changed files with 3 additions and 0 deletions
|
|
@ -44,6 +44,8 @@ impl<W: Write> Connection<W> {
|
|||
|
||||
pub fn run(&mut self, mut stream: &mut Read) -> io::Result<()> {
|
||||
self.stream.write(self.my_id.as_bytes())?;
|
||||
self.stream.flush()?;
|
||||
|
||||
self.peer_id = Some(self.read_id(stream)?);
|
||||
|
||||
if let Some(ref peer_id) = self.peer_id {
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ impl Packet {
|
|||
stream.write_u8(padding_len as u8)?;
|
||||
stream.write(&self.payload)?;
|
||||
stream.write(&[0u8; 255][..padding_len])?;
|
||||
stream.flush()?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue