From 363dfd93d318817ff07b757702448a10c5dccd44 Mon Sep 17 00:00:00 2001 From: link2xt Date: Fri, 31 Mar 2023 16:01:29 +0000 Subject: [PATCH] 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. --- src/imap_stream.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/imap_stream.rs b/src/imap_stream.rs index 039ddbf..4c2942d 100644 --- a/src/imap_stream.rs +++ b/src/imap_stream.rs @@ -48,12 +48,6 @@ impl ImapStream { } pub async fn encode(&mut self, msg: Request) -> Result<(), io::Error> { - if self.closed { - return Err(io::Error::new( - io::ErrorKind::BrokenPipe, - "inner stream closed", - )); - } log::trace!( "encode: input: {:?}, {:?}", msg.0,