]> git.g-eek.se Git - interimap.git/commitdiff
IDLE: fix race condition when an untagged response is received after the DONE
authorGuilhem Moulin <guilhem@fripost.org>
Thu, 10 Mar 2016 22:46:50 +0000 (23:46 +0100)
committerGuilhem Moulin <guilhem@fripost.org>
Thu, 10 Mar 2016 22:47:54 +0000 (23:47 +0100)
lib/Net/IMAP/InterIMAP.pm

index 33ad4eeb4b236090ef3c8a1e041c27ca88741253..45253c109603c53b264061e5ac7771fcdec85aea 100644 (file)
@@ -992,7 +992,9 @@ sub idle($;$&) {
     # done idling
     $self->_cmd_extend('DONE');
     $self->_cmd_flush();
-    $self->_recv($tag);
+    # run the callback again to update the return value if we received
+    # untagged responses between the DONE and the tagged response
+    $self->_recv($tag, $callback, 'IDLE');
 
     return $timeout < 0 ? 1 : 0;
 }