Skip to content

Commit

Permalink
fix: don't exit gpg server after just one connection
Browse files Browse the repository at this point in the history
  • Loading branch information
smlx committed Jul 26, 2021
1 parent ce2decb commit 253ff6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/piv-agent/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ loop:
for {
select {
case <-ctx.Done():
log.Debug("exit done")
break loop
case <-exit.C:
log.Debug("exit timeout")
Expand Down
4 changes: 3 additions & 1 deletion internal/server/gpg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 253ff6e

Please sign in to comment.