Commit 6d9ff4c2 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Assert the packet size and remove the related XXX.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@1129 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 45c34b7b
......@@ -369,9 +369,9 @@ class Connection(BaseConnection):
self.write_buf += packet.encode()
except PacketMalformedError, m:
logging.critical('trying to send a too big message')
# XXX: we should assert that the internalError packet has a size
# lower than MAX_PACKET_SIZE
return self.notify(protocol.internalError(m))
packet = protocol.internalError(m)
assert len(packet.body) < protocol.MAX_PACKET_SIZE
return self.notify(packet)
# If this is the first time, enable polling for writing.
if self.write_buf:
......
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