diff --git a/eventlet/twistedutil/protocol.py b/eventlet/twistedutil/protocol.py index 0055c42..45278a5 100644 --- a/eventlet/twistedutil/protocol.py +++ b/eventlet/twistedutil/protocol.py @@ -29,7 +29,7 @@ class Protocol(twistedProtocol): spawn(self.channel.send, data) def connectionLost(self, reason): - self.channel.send_exception(reason.value) + spawn(self.channel.send_exception, reason.value) self.channel = None # QQQ channel creates a greenlet. does it actually finish and memory is reclaimed? diff --git a/eventlet/twistedutil/protocols/basic.py b/eventlet/twistedutil/protocols/basic.py index 325cd71..03d817e 100644 --- a/eventlet/twistedutil/protocols/basic.py +++ b/eventlet/twistedutil/protocols/basic.py @@ -9,7 +9,7 @@ class LineOnlyReceiver(basic.LineOnlyReceiver): spawn(self.channel.send, line) def connectionLost(self, reason): - self.channel.send_exception(reason.value) + spawn(self.channel.send_exception, reason.value) class LineOnlyReceiverBuffer(BaseBuffer):