Skip to content

Commit aed66bb

Browse files
committed
Do not generate artificial "broken pipe" errors
`closed` flag is set when there is no more data to read from the stream. It does not mean that no more requests can be written into the stream. If the stream is closed for writing, `write_all` call will return this error, there is no need to emulate it.
1 parent 6bf0be9 commit aed66bb

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/imap_stream.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ impl<R: Read + Write + Unpin> ImapStream<R> {
4848
}
4949

5050
pub async fn encode(&mut self, msg: Request) -> Result<(), io::Error> {
51-
if self.closed {
52-
return Err(io::Error::new(
53-
io::ErrorKind::BrokenPipe,
54-
"inner stream closed",
55-
));
56-
}
5751
log::trace!(
5852
"encode: input: {:?}, {:?}",
5953
msg.0,

0 commit comments

Comments
 (0)