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 <Sebastian@SSpaeth.de> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
		 Sebastian Spaeth
					Sebastian Spaeth
				
			
				
					committed by
					
						 Nicolas Sebrecht
						Nicolas Sebrecht
					
				
			
			
				
	
			
			
			 Nicolas Sebrecht
						Nicolas Sebrecht
					
				
			
						parent
						
							fe4f385e2c
						
					
				
				
					commit
					7941ea7e7d
				
			| @@ -99,7 +99,7 @@ class IMAPFolder(BaseFolder): | |||||||
|                                                    True) |                                                    True) | ||||||
|             except OfflineImapError, e: |             except OfflineImapError, e: | ||||||
|                 # retry on dropped connections, raise otherwise |                 # retry on dropped connections, raise otherwise | ||||||
|                 self.imapserver.releaseconnection(imapobj, true) |                 self.imapserver.releaseconnection(imapobj, True) | ||||||
|                 if e.severity == OfflineImapError.ERROR.FOLDER_RETRY: |                 if e.severity == OfflineImapError.ERROR.FOLDER_RETRY: | ||||||
|                     retry = True |                     retry = True | ||||||
|                 else: raise |                 else: raise | ||||||
| @@ -221,7 +221,7 @@ class IMAPFolder(BaseFolder): | |||||||
|                     fails_left = 0 |                     fails_left = 0 | ||||||
|                 except imapobj.abort(), e: |                 except imapobj.abort(), e: | ||||||
|                     # Release dropped connection, and get a new one |                     # Release dropped connection, and get a new one | ||||||
|                     self.imapserver.releaseconnection(imapobj) |                     self.imapserver.releaseconnection(imapobj, True) | ||||||
|                     imapobj = self.imapserver.acquireconnection() |                     imapobj = self.imapserver.acquireconnection() | ||||||
|                     self.ui.error(e, exc_info()[2]) |                     self.ui.error(e, exc_info()[2]) | ||||||
|                     fails_left -= 1 |                     fails_left -= 1 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user