[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #6239 [Stem]: Implement SETCONF/RESETCONF parsing in Stem



#6239: Implement SETCONF/RESETCONF parsing in Stem
--------------------+-------------------------------------------------------
 Reporter:  neena   |          Owner:  neena       
     Type:  task    |         Status:  needs_review
 Priority:  normal  |      Milestone:              
Component:  Stem    |        Version:              
 Keywords:          |         Parent:              
   Points:          |   Actualpoints:              
--------------------+-------------------------------------------------------

Comment(by atagar):

 Oops, forgot the notes I took while reviewing it...

 > +def _case_insensitive_lookup(entries, key, default = UNDEFINED):

 Heh, I went back and forth on adding a default parameter while using this
 for get_conf(), but left it out since get_conf_map() (its only other user)
 didn't need it. Looks like I was wrong.

 Now I'm a little tempted to drop default in favor of just returning the
 key by default when lookup fails (since that's what all of its consumers
 want), but guess it's better to leave it as-is in case other queries want
 the default to be something else.

 > +      if response.message.startswith("Unrecognized option: Unknown
 option '"):
 > +        key = response.message[37:response.message.find("\'", 37)]
 > +        raise stem.socket.InvalidArguments(response.code,
 response.message, [key])

 What happens if there are multiple unknown options? Do we then fall
 through to raising a InvalidRequest? What sorts of issues did you see with
 a 513 and 553 status?

 > +__all__ = [
 > +  "control_message",
 > +  "control_line",
 > +  "getinfo",
 > +  "getconf",
 > +  "protocolinfo",
 > +  "authchallenge",
 > +  "singleline"
 > +]

 Good change. Mind changing the other __init__.py files too?

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6239#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs