Przeglądaj źródła

Use client platform from config if none provided

mirokuratczyk 7 lat temu
rodzic
commit
8a3f107178
1 zmienionych plików z 5 dodań i 2 usunięć
  1. 5 2
      ClientLibrary/PsiphonTunnel.go

+ 5 - 2
ClientLibrary/PsiphonTunnel.go

@@ -85,7 +85,8 @@ var managedStartResult *C.char
 //   }
 //   }
 //
 //
 // clientPlatform should be of the form OS_OSVersion_BundleIdentifier where both the OSVersion and BundleIdentifier 
 // clientPlatform should be of the form OS_OSVersion_BundleIdentifier where both the OSVersion and BundleIdentifier 
-// fields are optional.
+// fields are optional. If clientPlatform is set to an empty string the "ClientPlatform" field in the provided json
+// config will be used instead.
 //
 //
 // Provided below are links to platform specific code which can be used to find some of the above fields:
 // Provided below are links to platform specific code which can be used to find some of the above fields:
 //   Android:
 //   Android:
@@ -120,7 +121,9 @@ func Start(configJSON, embeddedServerEntryList, clientPlatform, networkID string
 
 
 	// Set client platform
 	// Set client platform
 
 
-	config.ClientPlatform = clientPlatform;
+	if clientPlatform != "" {
+		 config.ClientPlatform = clientPlatform;
+	}
 
 
 	// All config fields should be set before calling commit
 	// All config fields should be set before calling commit
 	err = config.Commit()
 	err = config.Commit()