Skip to content

Commit 118555e

Browse files
committed
fix: use write_all() to write space after a tag
`write()` should not return Ok without writing anything, but the documentation is not clear on this and underlying implementation may be wrong as IMAP can be run over various streams, e.g. compressed, encrypted, proxied. It is safer to use `write_all()` everywhere, even when we write a single byte.
1 parent b37821f commit 118555e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/imap_stream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<R: Read + Write + Unpin> ImapStream<R> {
4747

4848
if let Some(tag) = msg.0 {
4949
self.inner.write_all(tag.as_bytes()).await?;
50-
self.inner.write(b" ").await?;
50+
self.inner.write_all(b" ").await?;
5151
}
5252
self.inner.write_all(&msg.1).await?;
5353
self.inner.write_all(b"\r\n").await?;

0 commit comments

Comments
 (0)