diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-03-20 17:12:36 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-25 09:43:37 +0200 |
| commit | 1f599f1aab37343ff61852a8616c640310dfaee4 (patch) | |
| tree | f9784b2dc5c73ceab9fbc8cf6cdaab922385c553 /exports | |
| parent | cd4f13c5a8df0d7da2fbca3a741d396f220cff33 (diff) | |
Tests: Pass for V2 API
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/exports.go | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/exports/exports.go b/exports/exports.go index 19be174..fe7581e 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -62,7 +62,6 @@ func getReturnData(data interface{}) (string, error) { } func StateCallback( - state *client.Client, oldState client.FSMStateID, newState client.FSMStateID, data interface{}, @@ -97,20 +96,18 @@ func Register( stateCallback C.StateCB, debug C.int, ) *C.char { - state, stateErr := getVPNState() + _, stateErr := getVPNState() if stateErr == nil { return getCError(errors.New("failed to register, a VPN state is already present")) } - state = &client.Client{} + state := &client.Client{} VPNState = state PStateCallback = stateCallback registerErr := state.Register( C.GoString(name), C.GoString(version), C.GoString(configDirectory), - func(old client.FSMStateID, new client.FSMStateID, data interface{}) bool { - return StateCallback(state, old, new, data) - }, + StateCallback, debug == 1, ) |
