From 80d36400aa4c92d1b9e13fc1dfeee71ba41c49cc Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Wed, 5 Nov 2008 17:06:19 +0600 Subject: [PATCH] fixed buffers to wrap channel.send_exception with spawn, so that it doesn't block the mainloop --- eventlet/twistedutil/protocol.py | 2 +- eventlet/twistedutil/protocols/basic.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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):