diff --git a/cmd/piv-agent/serve.go b/cmd/piv-agent/serve.go index cde9115..d812db4 100644 --- a/cmd/piv-agent/serve.go +++ b/cmd/piv-agent/serve.go @@ -85,6 +85,7 @@ loop: for { select { case <-ctx.Done(): + log.Debug("exit done") break loop case <-exit.C: log.Debug("exit timeout") diff --git a/internal/server/gpg.go b/internal/server/gpg.go index c8a4d94..655d708 100644 --- a/internal/server/gpg.go +++ b/internal/server/gpg.go @@ -47,7 +47,9 @@ func (g *GPG) Serve(ctx context.Context, l net.Listener, exit *time.Ticker, a := assuan.New(conn, g.pivService) // run the protocol state machine to completion // (client severs connection) - return a.Run(conn) + if err := a.Run(conn); err != nil { + return err + } case <-ctx.Done(): return nil }