[tor-bugs] #18918 [Core Tor/Tor]: Clarify directory and ORPort checking functions

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jan 24 22:16:23 UTC 2018


#18918: Clarify directory and ORPort checking functions
-------------------------------------------------+-------------------------
 Reporter:  teor                                 |          Owner:  (none)
     Type:  defect                               |         Status:
                                                 |  needs_review
 Priority:  Medium                               |      Milestone:  Tor:
                                                 |  0.3.4.x-final
Component:  Core Tor/Tor                         |        Version:  Tor:
                                                 |  0.2.8.1-alpha
 Severity:  Normal                               |     Resolution:
 Keywords:  easy, doc, code, refactor            |  Actual Points:
  technical-debt tor-relay                       |
Parent ID:                                       |         Points:  1
 Reviewer:                                       |        Sponsor:
-------------------------------------------------+-------------------------
Changes (by ffmancera):

 * status:  new => needs_review


Comment:

 > Let's rename this to router_has_bandwidth_to_be_dirserver(). "to
 dirserver" is confusing, it could refer to another dirserver.

 Sorry I wrote it wrong in the ticket comment.

 > When we remove statements because they are obviously correct, we usually
 insert a tor_assert_nonfatal_once() or if(BUG()) to make sure the
 condition holds. If the condition depends on code outside the function,
 please check it inside the function.

 `tor_assert_nonfatal_once()` gave me a warning on tests so the conditions
 were needed.

 > If both functions are short, this is ok.
 > But if the combined function is longer than a standard terminal window
 (24 lines), let's not combine them.

 We shouldn't combine them because the combined function is longer than 24
 lines.

 Everything else was done, please check my github
 [https://github.com/ffmancera/tor-1/tree/bug18918 branch bug18918]. All
 tests pass succesfully and Travis CI seems happy, I hope everything is
 fine :-)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/18918#comment:12>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list