[tor-bugs] #3512 [Tor Client]: Functions that perform hostname lookup should be clearly labeled

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Fri Jul 1 18:24:27 UTC 2011


#3512: Functions that perform hostname lookup should  be clearly labeled
------------------------+---------------------------------------------------
 Reporter:  nickm       |          Owner:                    
     Type:  defect      |         Status:  new               
 Priority:  normal      |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Client  |        Version:                    
 Keywords:  easy        |         Parent:                    
   Points:              |   Actualpoints:                    
------------------------+---------------------------------------------------
 Quick quiz: which of the following might do a DNS lookup, and which don't?

 A. tor_addr_port_parse()
 B. parse_addr_port()
 C. tor_addr_lookup()
 D. tor_addr_parse_mask_ports()
 E. tor_addr_from_str()
 F. parse_addr_and_port_range()

 If remembered that A, B, and C can do DNS lookups, but that D, E, and F
 don't do DNS lookups, then you have a better memory than I.

 We should rename the functions here so that everything that does a resolve
 has "resolve" or "lookup" in its name, and everything that only has
 "parse" in its name is parsing-only.  We should also audit our use of the
 resolving functions to make sure that we're not calling any of them any
 place that we shouldn't.

 The renaming should hold off till after we've merged the IPv6 conversion,
 since that touches almost all of the code we'd want to alter here.

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


More information about the tor-bugs mailing list