control/controlclient: remove unused StartLogout

Updates #cleanup

Co-authored-by: Maisem Ali <maisem@tailscale.com>
Change-Id: I9d052fdbee787f1e8c872124e4bee61c7f04d142
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-08-30 18:33:58 -07:00
committed by Brad Fitzpatrick
parent ecc1d6907b
commit 04e1ce0034
7 changed files with 18 additions and 54 deletions

View File

@@ -3910,18 +3910,7 @@ func (b *LocalBackend) ShouldHandleViaIP(ip netip.Addr) bool {
return false
}
// Logout tells the controlclient that we want to log out, and
// transitions the local engine to the logged-out state without
// waiting for controlclient to be in that state.
func (b *LocalBackend) Logout() {
b.logout(context.Background(), false)
}
func (b *LocalBackend) LogoutSync(ctx context.Context) error {
return b.logout(ctx, true)
}
func (b *LocalBackend) logout(ctx context.Context, sync bool) error {
b.mu.Lock()
cc := b.cc
b.mu.Unlock()
@@ -3946,13 +3935,7 @@ func (b *LocalBackend) logout(ctx context.Context, sync bool) error {
return errors.New("no controlclient")
}
var err error
if sync {
err = cc.Logout(ctx)
} else {
cc.StartLogout()
}
err := cc.Logout(ctx)
b.stateMachine()
return err
}