[tor-commits] [stem/master] Catching 555 response from ATTACHSTREAM
atagar at torproject.org
atagar at torproject.org
Sun Apr 14 20:25:48 UTC 2013
commit 5268d28c885509de174e5b7c1a657bc0278fd797
Author: Damian Johnson <atagar at torproject.org>
Date: Sun Apr 14 13:22:54 2013 -0700
Catching 555 response from ATTACHSTREAM
ATTACHSTREAM should only respond with 250, 552, or 551 according to the spec
but someone came across a 555 response in the wild...
https://trac.torproject.org/8701
Tentatively handling this with OperationFailed until the spec is updated with
more information.
---
stem/control.py | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/stem/control.py b/stem/control.py
index 5b9a8ac..478384a 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1981,6 +1981,13 @@ class Controller(BaseController):
raise stem.InvalidRequest(response.code, response.message)
elif response.code == '551':
raise stem.OperationFailed(response.code, response.message)
+ elif response.code == '555':
+ # TODO: This response has been seen in the wild, but isn't valid
+ # according to the spec...
+ #
+ # https://trac.torproject.org/8701
+
+ raise stem.OperationFailed(response.code, response.message)
else:
raise stem.ProtocolError("ATTACHSTREAM returned unexpected response code: %s" % response.code)
More information about the tor-commits
mailing list