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

Re: [tor-bugs] #1692 [Tor Relay]: No Events for SETCONF



#1692: No Events for SETCONF
-------------------------+--------------------------------------------------
 Reporter:  atagar       |          Owner:  krkhan            
     Type:  enhancement  |         Status:  needs_review      
 Priority:  normal       |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Relay    |        Version:                    
 Keywords:               |         Parent:                    
   Points:               |   Actualpoints:                    
-------------------------+--------------------------------------------------
Changes (by rransom):

  * version:  Tor: unspecified =>
  * milestone:  Tor: unspecified => Tor: 0.2.3.x-final


Comment:

 Replying to [comment:18 rransom]:
 > Replying to [comment:16 krkhan]:
 > > Added the changes file.
 > >
 > >  *
 [https://github.com/krkhan/tor/commit/3b85fe8a5dd0fed88163ffc3bcb4eec8bf2053bc
 Commit]
 > >  * [https://github.com/krkhan/tor/compare/bug1692 Tor patch]
 > >
 > > Since the values don't contain CRLFs, I don't think they need to be
 escaped.
 >
 > Yes, they do.  (Option values might contain quotation marks, for
 example.)  Use either `esc_for_log` or `escaped`.

 Since you're passing the option values to a `printf`-like function, use
 `escaped`. For example:
 {{{
   smartlist_asprintf_add("650-%s=%s\r\n", key, escaped(value));
 }}}

 > Also, please move the code that constructs a key-value list into
 `control_event_conf_changed` -- that function should take as its arguments
 the old and new `or_options_t` structures, and only make a list of the
 options that changed if some control-port client actually wants a
 `CONF_CHANGED` event.

 From `control_event_circuit_status`:
 {{{
   if (!EVENT_IS_INTERESTING(EVENT_CIRCUIT_STATUS))
     return 0;
 }}}

 Your `CONF_CHANGED` event shouldn't happen nearly as often, but there's no
 point in not doing an optimization that easy.  (At the very least, your
 code is less likely to break a user's Tor instance if it doesn't run.)

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/1692#comment:19>
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