control/controlclient: make Auto.Shutdown call Direct.Close

Updates #3488

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali 2022-03-08 11:45:48 -08:00 committed by Maisem Ali
parent 0f37317664
commit 91a8cdc84b
1 changed files with 4 additions and 0 deletions

View File

@ -677,6 +677,7 @@ func (c *Auto) Shutdown() {
c.mu.Lock()
inSendStatus := c.inSendStatus
closed := c.closed
direct := c.direct
if !closed {
c.closed = true
c.statusFunc = nil
@ -685,6 +686,9 @@ func (c *Auto) Shutdown() {
c.logf("client.Shutdown: inSendStatus=%v", inSendStatus)
if !closed {
if direct != nil {
direct.Close()
}
c.unregisterHealthWatch()
close(c.quit)
c.cancelAuth()