|
|
@ -1251,11 +1251,21 @@ func (b *LocalBackend) requestEngineStatusAndWait() {
|
|
|
|
// rebooting will fix it.
|
|
|
|
// rebooting will fix it.
|
|
|
|
func (b *LocalBackend) Logout() {
|
|
|
|
func (b *LocalBackend) Logout() {
|
|
|
|
b.mu.Lock()
|
|
|
|
b.mu.Lock()
|
|
|
|
b.assertClientLocked()
|
|
|
|
|
|
|
|
c := b.c
|
|
|
|
c := b.c
|
|
|
|
b.netMap = nil
|
|
|
|
b.netMap = nil
|
|
|
|
b.mu.Unlock()
|
|
|
|
b.mu.Unlock()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if c == nil {
|
|
|
|
|
|
|
|
// Double Logout can happen via repeated IPN
|
|
|
|
|
|
|
|
// connections to ipnserver making it repeatedly
|
|
|
|
|
|
|
|
// transition from 1->0 total connections, which on
|
|
|
|
|
|
|
|
// Windows by default ("client mode") causes a Logout
|
|
|
|
|
|
|
|
// on the transition to zero.
|
|
|
|
|
|
|
|
// Previously this crashed when we asserted that c was non-nil
|
|
|
|
|
|
|
|
// here.
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
c.Logout()
|
|
|
|
c.Logout()
|
|
|
|
|
|
|
|
|
|
|
|
b.mu.Lock()
|
|
|
|
b.mu.Lock()
|
|
|
|