forked from bamthomas/aioimaplib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid race when entering/leaving idle mode
Use an event to wait/signal that the IDLE command has been acknowledged by receipt of a continuation line from the server, avoiding the idle_queue. When starting idle mode (idle_start), it isn't safe to assume that the results of reading from the idle queue is a continuation line, as the queue may have other content, such as: - an unsolicited server keepalive that just happens to arrive while the IDLE command is starting - an EXISTS from a previous IDLE loop (see bamthomas#30) - a 'stop_wait_server_push' from a previous IDLE loop, if the idle timeout coincided with receipt of a message from the server. Calling code should probably be draining the queue before initiating a new loop, but that wouldn't prevent an unsolicited server keepalive from racing. Fixes bamthomas#30
- Loading branch information
1 parent
497d6e8
commit cc08e7d
Showing
2 changed files
with
102 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters