Commit f9b5cea4 authored by Julien Muchembled's avatar Julien Muchembled

Do not try to send notifications on closed connections

Now we can assert that abort is not called when it shouldn't be.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@2728 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 81cbbeeb
......@@ -180,11 +180,9 @@ class HandlerSwitcher(object):
else:
neo.lib.logging.error(
'Unexpected answer %r in %r', packet, connection)
if not connection.isClosed():
notification = Packets.Notify('Unexpected answer: %r' % packet)
try:
connection.notify(notification)
except ConnectorConnectionClosedException:
pass
connection.abort()
handler.peerBroken(connection)
# apply a pending handler if no more answers are pending
......@@ -476,6 +474,7 @@ class Connection(BaseConnection):
"""Abort dealing with this connection."""
neo.lib.logging.debug('aborting a connector for %r', self)
self.aborted = True
assert self.write_buf
def writable(self):
"""Called when self is writable."""
......
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