diff options
| author | Brad Fitzpatrick <bradfitz@tailscale.com> | 2022-08-03 21:51:02 -0700 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@tailscale.com> | 2022-08-03 21:51:42 -0700 |
| commit | 698defd54b4128eaa8278ff4ef1e15370682f1fe (patch) | |
| tree | db4eadf5e0cacc3176ee4e26511a3ef28a8dbd38 /ssh/tailssh/tailssh.go | |
| parent | c378a9900c56b33b6f7174894d8261d189e97185 (diff) | |
| download | tailscale-bradfitz/appendf.tar.xz tailscale-bradfitz/appendf.zip | |
syncs, all: move to using Go's new atomic types instead of oursbradfitz/appendf
Fixes #5185
Change-Id: I850dd532559af78c3895e2924f8237ccc328449d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Diffstat (limited to 'ssh/tailssh/tailssh.go')
| -rw-r--r-- | ssh/tailssh/tailssh.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ssh/tailssh/tailssh.go b/ssh/tailssh/tailssh.go index bf168c3ec..06b8460dc 100644 --- a/ssh/tailssh/tailssh.go +++ b/ssh/tailssh/tailssh.go @@ -30,6 +30,7 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" gossh "github.com/tailscale/golang-x-crypto/ssh" @@ -37,7 +38,6 @@ import ( "tailscale.com/ipn/ipnlocal" "tailscale.com/logtail/backoff" "tailscale.com/net/tsaddr" - "tailscale.com/syncs" "tailscale.com/tailcfg" "tailscale.com/tempfork/gliderlabs/ssh" "tailscale.com/types/logger" @@ -645,7 +645,7 @@ func (c *conn) resolveTerminalActionLocked(s ssh.Session, cr *contextReader) (ac action = c.action0 var awaitReadOnce sync.Once // to start Reads on cr - var sawInterrupt syncs.AtomicBool + var sawInterrupt atomic.Bool var wg sync.WaitGroup defer wg.Wait() // wait for awaitIntrOnce's goroutine to exit @@ -687,7 +687,7 @@ func (c *conn) resolveTerminalActionLocked(s ssh.Session, cr *contextReader) (ac return } if n > 0 && buf[0] == 0x03 { // Ctrl-C - sawInterrupt.Set(true) + sawInterrupt.Store(true) s.Stderr().Write([]byte("Canceled.\r\n")) s.Exit(1) return @@ -699,7 +699,7 @@ func (c *conn) resolveTerminalActionLocked(s ssh.Session, cr *contextReader) (ac var err error action, err = c.fetchSSHAction(ctx, url) if err != nil { - if sawInterrupt.Get() { + if sawInterrupt.Load() { metricTerminalInterrupt.Add(1) return nil, fmt.Errorf("aborted by user") } else { |
