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

Merge pull request #84 from rod-hynes/master

Bug fixes for Windows client release
Rod Hynes 11 лет назад
Родитель
Сommit
20dca8745e
3 измененных файлов с 13 добавлено и 8 удалено
  1. 0 8
      psiphon/config.go
  2. 8 0
      psiphon/remoteServerList.go
  3. 5 0
      psiphon/splitTunnel.go

+ 0 - 8
psiphon/config.go

@@ -111,14 +111,6 @@ func LoadConfig(configJson []byte) (*Config, error) {
 		return nil, ContextError(
 		return nil, ContextError(
 			errors.New("sponsor ID is missing from the configuration file"))
 			errors.New("sponsor ID is missing from the configuration file"))
 	}
 	}
-	if config.RemoteServerListUrl == "" {
-		return nil, ContextError(
-			errors.New("remote server list URL is missing from the configuration file"))
-	}
-	if config.RemoteServerListSignaturePublicKey == "" {
-		return nil, ContextError(
-			errors.New("remote server list signature public key is missing from the configuration file"))
-	}
 
 
 	if config.DataStoreDirectory == "" {
 	if config.DataStoreDirectory == "" {
 		config.DataStoreDirectory, err = os.Getwd()
 		config.DataStoreDirectory, err = os.Getwd()

+ 8 - 0
psiphon/remoteServerList.go

@@ -20,6 +20,7 @@
 package psiphon
 package psiphon
 
 
 import (
 import (
+	"errors"
 	"io/ioutil"
 	"io/ioutil"
 	"net/http"
 	"net/http"
 )
 )
@@ -31,6 +32,13 @@ import (
 func FetchRemoteServerList(config *Config, dialConfig *DialConfig) (err error) {
 func FetchRemoteServerList(config *Config, dialConfig *DialConfig) (err error) {
 	NoticeInfo("fetching remote server list")
 	NoticeInfo("fetching remote server list")
 
 
+	if config.RemoteServerListUrl == "" {
+		return ContextError(errors.New("remote server list URL is blank"))
+	}
+	if config.RemoteServerListSignaturePublicKey == "" {
+		return ContextError(errors.New("remote server list signature public key blank"))
+	}
+
 	transport := &http.Transport{
 	transport := &http.Transport{
 		Dial: NewTCPDialer(dialConfig),
 		Dial: NewTCPDialer(dialConfig),
 	}
 	}

+ 5 - 0
psiphon/splitTunnel.go

@@ -114,6 +114,11 @@ func (classifier *SplitTunnelClassifier) Start(fetchRoutesTunnel *Tunnel) {
 		return
 		return
 	}
 	}
 
 
+	if fetchRoutesTunnel.session == nil {
+		// Tunnel has no session
+		return
+	}
+
 	if fetchRoutesTunnel.session.clientRegion == "" {
 	if fetchRoutesTunnel.session.clientRegion == "" {
 		// Split tunnel region is unknown
 		// Split tunnel region is unknown
 		return
 		return