summaryrefslogtreecommitdiff
path: root/exports
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2023-08-16 13:25:15 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2023-09-25 09:43:37 +0200
commitf583a28694be3ec3b99318673c6cdb6e42ee1372 (patch)
treea80e65573f3db46212f1b31a865ece499e574d66 /exports
parentb0e1fdb2ee09e10c2f2f8a78e14d39282595fab5 (diff)
Client + Exports + Python: Add a startup boolean to getconfig
To be used for autoconnect on startup. If autoconnect on startup set to true This ignores any callbacks that require user input (profile, authorization & location callbacks)
Diffstat (limited to 'exports')
-rw-r--r--exports/exports.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/exports/exports.go b/exports/exports.go
index 4a92f1a..9ca053b 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -312,6 +312,8 @@ func ServerList() (*C.char, *C.char) {
// - In case of custom server: The base URL
// - In case of institute access: The base URL
// pTCP is if we prefer TCP or not to get the configuration, non-zero means yes
+// startup is if the client is just starting up, set this to true (non-zero) if you autoconnect to a server on startup
+// If this startup value is true (non-zero) then any authorization or other callacks (profile/location) are not triggered
// If the server cannot be added it returns the error as types/error/error.go Error
// Note that the server is removed when an error has occured
// The current state callbacks MUST be handled
@@ -349,7 +351,7 @@ func ServerList() (*C.char, *C.char) {
// This is nil if an error is returned as types/error/error.go Error
//
//export GetConfig
-func GetConfig(c C.uintptr_t, _type C.int, id *C.char, pTCP C.int) (*C.char, *C.char) {
+func GetConfig(c C.uintptr_t, _type C.int, id *C.char, pTCP C.int, startup C.int) (*C.char, *C.char) {
state, stateErr := getVPNState()
if stateErr != nil {
return nil, getCError(stateErr)
@@ -359,7 +361,8 @@ func GetConfig(c C.uintptr_t, _type C.int, id *C.char, pTCP C.int) (*C.char, *C.
return nil, getCError(err)
}
preferTCPBool := pTCP != 0
- cfg, err := state.GetConfig(ck, C.GoString(id), srvtypes.Type(_type), preferTCPBool)
+ startupBool := startup != 0
+ cfg, err := state.GetConfig(ck, C.GoString(id), srvtypes.Type(_type), preferTCPBool, startupBool)
if cfg != nil && err == nil {
d, err := getReturnData(cfg)
if err == nil {