Kaynağa Gözat

Merge pull request #86 from rod-hynes/master

Fix: NoticeUpstreamProxyError bugs
Rod Hynes 11 yıl önce
ebeveyn
işleme
e0af313a4b
2 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 4 2
      psiphon/TCPConn_windows.go
  2. 1 1
      psiphon/notice.go

+ 4 - 2
psiphon/TCPConn_windows.go

@@ -73,8 +73,10 @@ func interruptibleTCPDial(addr string, config *DialConfig) (conn *TCPConn, err e
 
 		netConn, err := net.DialTimeout("tcp", dialAddr, config.ConnectTimeout)
 
-		if err == nil && config.UpstreamHttpProxyAddress != "" {
-			err = HttpProxyConnect(netConn, addr)
+		if config.UpstreamHttpProxyAddress != "" {
+			if err == nil {
+				err = HttpProxyConnect(netConn, addr)
+			}
 			if err != nil {
 				NoticeUpstreamProxyError(err)
 			}

+ 1 - 1
psiphon/notice.go

@@ -177,7 +177,7 @@ func NoticeSplitTunnelRegion(region string) {
 // NoticeUpstreamProxyError reports an error when connecting to an upstream proxy. The
 // user may have input, for example, an incorrect address or incorrect credentials.
 func NoticeUpstreamProxyError(err error) {
-	outputNotice("UpstreamProxyError", true, "errorMessage", fmt.Sprintf("%s", err))
+	outputNotice("UpstreamProxyError", true, "message", fmt.Sprintf("%s", err))
 }
 
 type noticeObject struct {