[tor-bugs] #12087 [Pluggable transport]: goptlib could provide IsClient()/IsServer().

Tor Bug Tracker & Wiki blackhole at torproject.org
Sun May 25 18:11:24 UTC 2014


#12087: goptlib could provide IsClient()/IsServer().
-------------------------------------+------------------------------
     Reporter:  yawning              |      Owner:  asn
         Type:  enhancement          |     Status:  needs_review
     Priority:  minor                |  Milestone:
    Component:  Pluggable transport  |    Version:
   Resolution:                       |   Keywords:  goptlib, library
Actual Points:                       |  Parent ID:
       Points:                       |
-------------------------------------+------------------------------

Comment (by dcf):

 I'm starting to think we should just recommend that applications that need
 this feature do:
 {{{
 if os.Getenv("TOR_PT_CLIENT_TRANSPORTS") != "" {
         // assume client mode
 } else {
         // assume server mode
 }
 }}}
 It so short and simple. In reality it will never break. ClientSetup and
 ServerSetup will check for environment brokenness, as they have to do
 anyway. This feels like a good, wholesome abstraction breakage to me. It
 makes the programmer's intention clear, it makes it obvious what's really
 happening, it avoids the complexity and design decisions of some other
 proposals in this ticket, it feels like a good move all around.

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


More information about the tor-bugs mailing list