Throw away broken connections
Signed-off-by: Ethan Glasser-Camp <ethan@betacantrips.com> Signed-off-by: Nicolas Sebrecht <nicolas.s-dev@laposte.net>
This commit is contained in:
parent
197030da1a
commit
a139d9deed
@ -154,7 +154,11 @@ class IMAPServer:
|
|||||||
"""Releases a connection, returning it to the pool."""
|
"""Releases a connection, returning it to the pool."""
|
||||||
self.connectionlock.acquire()
|
self.connectionlock.acquire()
|
||||||
self.assignedconnections.remove(connection)
|
self.assignedconnections.remove(connection)
|
||||||
self.availableconnections.append(connection)
|
# Don't reuse broken connections
|
||||||
|
if connection.Terminate:
|
||||||
|
connection.logout()
|
||||||
|
else:
|
||||||
|
self.availableconnections.append(connection)
|
||||||
self.connectionlock.release()
|
self.connectionlock.release()
|
||||||
self.semaphore.release()
|
self.semaphore.release()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user