Просмотр исходного кода

Fix build on Windows (bind-to-device changes)

Rod Hynes 11 лет назад
Родитель
Сommit
0620b8e1d2
2 измененных файлов с 3 добавлено и 3 удалено
  1. 1 1
      psiphon/LookupIP_nobind.go
  2. 2 2
      psiphon/TCPConn_windows.go

+ 1 - 1
psiphon/LookupIP_nobind.go

@@ -30,7 +30,7 @@ import (
 // simply uses net.LookuIP.
 // simply uses net.LookuIP.
 func LookupIP(host string, config *DialConfig) (addrs []net.IP, err error) {
 func LookupIP(host string, config *DialConfig) (addrs []net.IP, err error) {
 	if config.BindToDeviceProvider != nil {
 	if config.BindToDeviceProvider != nil {
-		return nil, errors.New("LookupIP with bind not supported on this platform")
+		return nil, ContextError(errors.New("LookupIP with bind not supported on this platform"))
 	}
 	}
 	return net.LookupIP(host)
 	return net.LookupIP(host)
 }
 }

+ 2 - 2
psiphon/TCPConn_windows.go

@@ -43,8 +43,8 @@ type interruptibleDialResult struct {
 }
 }
 
 
 func interruptibleTCPDial(addr string, config *DialConfig) (conn *TCPConn, err error) {
 func interruptibleTCPDial(addr string, config *DialConfig) (conn *TCPConn, err error) {
-	if config.BindToDevice != nil {
-		Fatal("psiphon.interruptibleTCPDial with bind not supported on Windows")
+	if config.BindToDeviceProvider != nil {
+		return nil, ContextError(errors.New("psiphon.interruptibleTCPDial with bind not supported on Windows"))
 	}
 	}
 
 
 	conn = &TCPConn{
 	conn = &TCPConn{