Commit b9f2fe83 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Bug fix: Do not select aborted connections.

Aborted connections are supposed to be closed but remains until the write
buffer is sent. Those connections must not be used for common operation
(broacast node information...).

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1674 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent d6bceadd
......@@ -124,6 +124,9 @@ class BaseConnection(object):
def getUUID(self):
return None
def isAborted(self):
return False
def isListening(self):
return False
......@@ -196,6 +199,9 @@ class Connection(BaseConnection):
if connector is not None:
event_manager.addReader(self)
def isAborted(self):
return self.aborted
def getUUID(self):
return self.uuid
......
......@@ -102,13 +102,13 @@ class EpollEventManager(object):
self._pending_processing = []
def getConnectionList(self):
return self.connection_dict.values()
return [x for x in self.connection_dict.values() if not x.isAborted()]
def getClientList(self):
return [c for c in self.connection_dict.values() if c.isClient()]
return [c for c in self.getConnectionList() if c.isClient()]
def getServerList(self):
return [c for c in self.connection_dict.values() if c.isServer()]
return [c for c in self.getConnectionList() if c.isServer()]
def getConnectionByUUID(self, uuid):
# XXX: deprecated, use getConnectionListByUUID instead.
......@@ -124,7 +124,7 @@ class EpollEventManager(object):
return None
result = []
append = result.append
for conn in self.connection_dict.values():
for conn in self.getConnectionList():
if conn.getUUID() == uuid:
append(conn)
return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment