From 7941ea7e7d6baf5549689946cbe1b8e476fb93fc Mon Sep 17 00:00:00 2001 From: Sebastian Spaeth Date: Mon, 12 Sep 2011 10:26:43 +0200 Subject: [PATCH] folder.IMAP: Make use of the new connection discarding In getmessage() we were releaseing a connection when we detected a dropped connection, but it turns out that this was not enough, we need to explicitely discard it when we detect a dropped one. So add the drop_conn=True parameter that was recently introduced to force the discarding of the dead conection. Signed-off-by: Sebastian Spaeth Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/IMAP.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/offlineimap/folder/IMAP.py b/offlineimap/folder/IMAP.py index 25ebe38..034d80d 100644 --- a/offlineimap/folder/IMAP.py +++ b/offlineimap/folder/IMAP.py @@ -99,7 +99,7 @@ class IMAPFolder(BaseFolder): True) except OfflineImapError, e: # retry on dropped connections, raise otherwise - self.imapserver.releaseconnection(imapobj, true) + self.imapserver.releaseconnection(imapobj, True) if e.severity == OfflineImapError.ERROR.FOLDER_RETRY: retry = True else: raise @@ -117,7 +117,7 @@ class IMAPFolder(BaseFolder): # Different number of messages than last time? if maxmsgid != statusfolder.getmessagecount(): return True - return False + return False def cachemessagelist(self): maxage = self.config.getdefaultint("Account %s" % self.accountname, @@ -221,7 +221,7 @@ class IMAPFolder(BaseFolder): fails_left = 0 except imapobj.abort(), e: # Release dropped connection, and get a new one - self.imapserver.releaseconnection(imapobj) + self.imapserver.releaseconnection(imapobj, True) imapobj = self.imapserver.acquireconnection() self.ui.error(e, exc_info()[2]) fails_left -= 1