From 653ce38bfb7ac03722db9e58b3121e9fff356698 Mon Sep 17 00:00:00 2001 From: aagbsn Date: Thu, 17 Nov 2011 08:52:20 -0800 Subject: 4503 - catch ErrorReply TorCtl may raise an ErrorReply when we try to close a stream that is not ours. TorBEL will now catch the exception and log the error message --- controller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controller.py b/controller.py index fe6dbf7..b94c79e 100644 --- a/controller.py +++ b/controller.py @@ -853,6 +853,12 @@ class Controller(TorCtl.EventHandler): except TorCtl.TorCtlClosed: # Bail if we closed. return + except TorCtl.ErrorReply, e: + # We can receive "552 Unknown stream" if Tor pukes on the stream + # before we actually receive the event and use it. + log.error("(%s, %d): Error attaching stream!", + router.nickname, event.target_port) + return if narrow: self.narrow(stream.router, event.target_port) -- cgit v1.2.1