* lib/mudpy/misc.py(User.flush): When sending on a user's socket raises
BrokenPipeError, their connection has probably dropped. Go ahead and set
their state to disconnecting so the socket will be cleaned up earily.
This also stops spamming the log on every failed write to a broken
socket before it eventually times out in the TCP/IP stack as well.
try:
self.connection.send(self.output_queue[0])
del self.output_queue[0]
- except:
+ except BrokenPipeError:
if self.account and self.account.get("name"):
account = self.account.get("name")
else:
account = "an unknown user"
- log("Sending to %s raised an exception (broken pipe?)."
- % account, 7)
- pass
+ log("Broken pipe sending to %s." % account, 7)
+ self.state = "disconnecting"
def enqueue_input(self):
"""Process and enqueue any new input."""