[tor-bugs] #17224 [Tor]: Refactor common parts of parse_dir_authority_line and parse_dir_fallback_line

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Oct 3 14:26:44 UTC 2015


#17224: Refactor common parts of parse_dir_authority_line and
parse_dir_fallback_line
-------------------------+------------------------------
 Reporter:  teor         |          Owner:
     Type:  enhancement  |         Status:  new
 Priority:  minor        |      Milestone:  Tor: 0.2.???
Component:  Tor          |        Version:
 Keywords:  lorax easy   |  Actual Points:
Parent ID:               |         Points:
  Sponsor:               |
-------------------------+------------------------------
 There's a lot of common code in parse_dir_authority_line and
 parse_dir_fallback_line that could be refactored into a shared function.

 What needs to be done is:
 * identify common code
 * create a common loop that parses the key=value pairs it understands,
 deletes them, and leaves the rest alone
 * put that loop in its own function that takes pointers (or pointer
 pointers?), returns values in those that are included, and returns NULL in
 those that aren't.
 * check this loop's output from both functions to ensure they each get
 what they need, then do the specific bits on the remaining arguments
 * call a common function to parse the IPv4:Port at the start of the line,
 then delete it
 * call a common function to parse the hex digest, which should be the only
 remaining thing

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


More information about the tor-bugs mailing list