Skip to content

Commit

Permalink
ticket #8605
Browse files Browse the repository at this point in the history
  • Loading branch information
sreenatha123 committed Apr 16, 2013
1 parent 1ad1f71 commit 0339974
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions stem/response/__init__.py
Expand Up @@ -143,8 +143,17 @@ def from_str(content):
:returns: stem.response.ControlMessage instance
"""

return stem.socket.recv_message(StringIO.StringIO(content))
message = stem.socket.recv_message(StringIO.StringIO(content))
message_content = message.content()
keyword = message_content[0][2].split()[0]

This comment has been minimized.

Copy link
@sreenatha123

sreenatha123 Apr 16, 2013

Author Owner

referred to lines 996, 1120, 1167 of tor control-spec (https://gitweb.torproject.org/torspec.git/blob/HEAD:/control-spec.txt)

if keyword == 'PROTOCOLINFO':
stem.response.convert("PROTOCOLINFO", message)
elif keyword == 'AUTHCHALLENGE':
stem.response.convert("AUTHCHALLENGE", message)
elif message_content[0][0][0]=='6':
stem.response.convert("EVENT", message)

return message

from_str = staticmethod(from_str)

Expand Down

0 comments on commit 0339974

Please sign in to comment.