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

[tor-bugs] #25291 [Core Tor/Tor]: get rid of redundant should_record_bridge_info() call in options_act()



#25291: get rid of redundant should_record_bridge_info() call in options_act()
------------------------------+--------------------------------
     Reporter:  arma          |      Owner:  (none)
         Type:  enhancement   |     Status:  new
     Priority:  Medium        |  Milestone:  Tor: 0.3.4.x-final
    Component:  Core Tor/Tor  |    Version:
     Severity:  Normal        |   Keywords:
Actual Points:                |  Parent ID:
       Points:                |   Reviewer:
      Sponsor:                |
------------------------------+--------------------------------
 In options_act() we have
 {{{
     if ((!old_options || !old_options->EntryStatistics) &&
         options->EntryStatistics && !should_record_bridge_info(options)) {
 }}}

 But right above that we have
 {{{
     /* Only collect other relay-only statistics on relays. */
     if (!public_server_mode(options)) {
       options->CellStatistics = 0;
       options->EntryStatistics = 0;
 }}}

 So the only way EntryStatistics could be non-zero at that lower point is
 if public_server_mode() is true.

 So the check to !should_record_bridge_info() will always be true, and is
 redundant to check.

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