-
-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
This is a follow-up to #66 bug. While setting the number of bytes requested by the parser in #74 made the issue harder to reproduce and fixed particular testcase, the original issue of closed
state being erroneously set was not investigated.
I looked into it and found that async-imap sometimes tries to read into a zero-sized buffer, then treats zero read bytes as the indication of closed stream:
https://github.com/async-email/async-imap/blob/1963cedefc9828ce994eb63e01afcf5c1c65d4c9/src/imap_stream.rs#L288-L303
ensure_capacity()
at the beginning of this snippet is supposed to ensure at least one byte is free in the buffer, but due to a bug it sometimes does not allocate even a single byte. I reproduced the issue at #77.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working