diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-22 09:55:19 +0200 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-04-22 09:55:19 +0200 |
| commit | 08b5cab875f1a84162bb47773bbe72135135b90e (patch) | |
| tree | 1228363b956b10b240fe05b13c9d9bb2e79d9bb6 /src/state.go | |
| parent | c7efec780a9e11e97690a19cf751533279788e79 (diff) | |
FSM: Make data for transitions optional
Diffstat (limited to 'src/state.go')
| -rw-r--r-- | src/state.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/state.go b/src/state.go index 52a4861..e15cb3c 100644 --- a/src/state.go +++ b/src/state.go @@ -51,7 +51,7 @@ func (state *VPNState) Register(name string, directory string, stateCallback fun // This error can be safely ignored, as when the config does not load, the struct will not be filled state.Log(LOG_INFO, "Previous configuration not found") } - state.GoTransition(NO_SERVER, "") + state.GoTransition(NO_SERVER) return nil } @@ -87,17 +87,17 @@ func (state *VPNState) Connect(url string) (string, error) { return "", loginErr } } else { // OAuth was valid, ensure we are in the authenticated state - state.GoTransition(AUTHENTICATED, "") + state.GoTransition(AUTHENTICATED) } - state.GoTransition(REQUEST_CONFIG, "") + state.GoTransition(REQUEST_CONFIG) config, configErr := state.Server.GetConfig() if configErr != nil { return "", configErr } else { - state.GoTransition(HAS_CONFIG, "") + state.GoTransition(HAS_CONFIG) } return config, nil |
