Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
complete_io: make non-blocking error return reachable
This function is complex because it does too much (we should fix that)
but roughly either operates in "handshake" or "data" mode.

The condition here is unreachable in "data" mode (thanks to the line above).

In "handshake" mode IO flips between reading and writing rather than doing
both at once, so it is rare that both reading and writing are attempted in
one loop.
  • Loading branch information
ctz committed Jul 29, 2025
commit a1aa8c8da99d07b37ff5d6dfb9c1d3fbeec3a138
2 changes: 1 addition & 1 deletion rustls/src/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,9 @@ impl<Data> ConnectionCommon<Data> {
let blocked = blocked_write.zip(blocked_read);
match (eof, until_handshaked, self.is_handshaking(), blocked) {
(_, true, false, _) => return Ok((rdlen, wrlen)),
(_, _, _, Some((e, _))) if rdlen == 0 && wrlen == 0 => return Err(e),
(_, false, _, _) => return Ok((rdlen, wrlen)),
(true, true, true, _) => return Err(io::Error::from(io::ErrorKind::UnexpectedEof)),
(_, _, _, Some((e, _))) => return Err(e),
_ => {}
}
}
Expand Down