Browse Source

Fix: race condition with reference to 'conn'

Rod Hynes 11 years ago
parent
commit
5b17fe03b8
1 changed files with 2 additions and 2 deletions
  1. 2 2
      psiphon/TCPConn_unix.go

+ 2 - 2
psiphon/TCPConn_unix.go

@@ -106,11 +106,11 @@ func interruptibleTCPDial(addr string, config *DialConfig) (conn *TCPConn, err e
 			errChannel <- errors.New("connect timeout")
 		})
 		go func() {
-			errChannel <- syscall.Connect(conn.interruptible.socketFd, &sockAddr)
+			errChannel <- syscall.Connect(socketFd, &sockAddr)
 		}()
 		err = <-errChannel
 	} else {
-		err = syscall.Connect(conn.interruptible.socketFd, &sockAddr)
+		err = syscall.Connect(socketFd, &sockAddr)
 	}
 	if err != nil {
 		return nil, ContextError(err)