Commit 0a3dba8b authored by Julien Muchembled's avatar Julien Muchembled

Use existing generic way to ignore AcceptIdentification on closed connections

parent 9d7f9795
...@@ -152,11 +152,6 @@ class EventHandler(object): ...@@ -152,11 +152,6 @@ class EventHandler(object):
acceptIdentification = self._acceptIdentification acceptIdentification = self._acceptIdentification
except AttributeError: except AttributeError:
raise UnexpectedPacketError('no handler found') raise UnexpectedPacketError('no handler found')
if conn.isClosed():
# acceptIdentification received on a closed (probably aborted,
# actually) connection. Reject any further packet as unexpected.
conn.setHandler(EventHandler(self.app))
return
node = self.app.nm.getByAddress(conn.getAddress()) node = self.app.nm.getByAddress(conn.getAddress())
assert node.getConnection() is conn, (node.getConnection(), conn) assert node.getConnection() is conn, (node.getConnection(), conn)
if node.getType() == node_type: if node.getType() == node_type:
......
...@@ -1673,7 +1673,7 @@ class Packets(dict): ...@@ -1673,7 +1673,7 @@ class Packets(dict):
Error = register( Error = register(
Error) Error)
RequestIdentification, AcceptIdentification = register( RequestIdentification, AcceptIdentification = register(
RequestIdentification) RequestIdentification, ignore_when_closed=True)
# Code of RequestIdentification packet must never change so that 2 # Code of RequestIdentification packet must never change so that 2
# incompatible nodes can reject themselves gracefully (i.e. comparing # incompatible nodes can reject themselves gracefully (i.e. comparing
# protocol versions) instead of raising PacketMalformedError. # protocol versions) instead of raising PacketMalformedError.
......
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