summaryrefslogtreecommitdiff
path: root/exports
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-22 18:46:37 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-08-22 18:46:37 +0200
commitd41af72a9673728cfe9390e31cb4e67da31fc355 (patch)
tree3951df72f57737e30aa012d33c8bac135a2e6e84 /exports
parent9c4da0277824c4d27cae4bc3f29d9c9708da3864 (diff)
State + Exports: Make cleanup optional when entering disconnect
Diffstat (limited to 'exports')
-rw-r--r--exports/exports.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/exports/exports.go b/exports/exports.go
index 3ebd7f0..a6dbaf6 100644
--- a/exports/exports.go
+++ b/exports/exports.go
@@ -244,13 +244,13 @@ func SetSearchServer(name *C.char) *C.char {
}
//export SetDisconnected
-func SetDisconnected(name *C.char) *C.char {
+func SetDisconnected(name *C.char, cleanup C.int) *C.char {
nameStr := C.GoString(name)
state, stateErr := GetVPNState(nameStr)
if stateErr != nil {
return C.CString(ErrorToString(stateErr))
}
- setDisconnectedErr := state.SetDisconnected()
+ setDisconnectedErr := state.SetDisconnected(int(cleanup) == 1)
return C.CString(ErrorToString(setDisconnectedErr))
}