[tor-bugs] #14135 [meek]: Incorrect SocksListener temporary error check

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Jan 8 21:00:23 UTC 2015


#14135: Incorrect SocksListener temporary error check
--------------------+---------------------
 Reporter:  adam-p  |          Owner:  dcf
     Type:  defect  |         Status:  new
 Priority:  minor   |      Milestone:
Component:  meek    |        Version:
 Keywords:          |  Actual Points:
Parent ID:          |         Points:
--------------------+---------------------
 You can see the code in question -- in `acceptLoop()` -- here:
 https://gitweb.torproject.org/pluggable-transports/meek.git/tree/meek-
 client/meek-client.go#n300

 The existing code will treat an error that is not a `net.Error` as
 temporary, which is the reverse of how it should be. See the diff to fix
 it below.

 Note that it is highly unlikely (impossible?) that the existing code would
 have caused an actual problem.

 (The code in question is probably based on [the
 example](https://github.com/Yawning/goptlib/blob/master/socks.go#L76) in
 the goptlib code. I have also submitted a [pull
 request](https://github.com/Yawning/goptlib/pull/1) to fix that example.)

 {{{#!diff
 diff --git a/meek-client/meek-client.go b/meek-client/meek-client.go
 index 280ab1b..bb6c0b1 100644
 --- a/meek-client/meek-client.go
 +++ b/meek-client/meek-client.go
 @@ -303,10 +303,11 @@ func acceptLoop(ln *pt.SocksListener) error {
                 conn, err := ln.AcceptSocks()
                 if err != nil {
                         log.Printf("error in AcceptSocks: %s", err)
 -                       if e, ok := err.(net.Error); ok && !e.Temporary()
 {
 -                               return err
 +                       if e, ok := err.(net.Error); ok && e.Temporary() {
 +
 +                               continue
                         }
 -                       continue
 +                       return err
                 }
                 go func() {
                         err := handler(conn)
 }}}

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


More information about the tor-bugs mailing list