3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-21 16:00:57 +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: try:
self._socket.send(encoded_data) self._socket.send(encoded_data)
except (OSError, AttributeError): except:
log.exception("(%s) Failed to send message %r; did the network disconnect?", self.name, data) log.exception("(%s) Failed to send message %r; aborting!", self.name, data)
self.disconnect()
def send(self, data, queue=True): def send(self, data, queue=True):
"""send() wrapper with optional queueing support.""" """send() wrapper with optional queueing support."""