3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

IRCNetwork: abort when _send() fails to avoid deadlocks

This commit is contained in:
James Lu 2018-03-07 18:30:14 -08:00
parent c49147f232
commit 8f9b56e9d9

View File

@ -1594,8 +1594,9 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
try:
self._socket.send(encoded_data)
except (OSError, AttributeError):
log.exception("(%s) Failed to send message %r; did the network disconnect?", self.name, data)
except:
log.exception("(%s) Failed to send message %r; aborting!", self.name, data)
self.disconnect()
def send(self, data, queue=True):
"""send() wrapper with optional queueing support."""