If sending to a user's socket results in a connection reset
response, treat this as the same as a broken pipe and clean up the
session.
if self.output_queue:
try:
self.connection.send(self.output_queue[0])
- except BrokenPipeError:
+ except (BrokenPipeError, ConnectionResetError):
if self.account and self.account.get("name"):
account = self.account.get("name")
else:
account = "an unknown user"
self.state = "disconnecting"
- log("Broken pipe sending to %s." % account, 7)
+ log("Disconnected while sending to %s." % account, 7)
del self.output_queue[0]
def enqueue_input(self):