Ignore EOF

This commit is contained in:
Bryce Lampe
2024-04-17 12:27:03 -07:00
parent 43979f6d93
commit b9a801e8ae

View File

@@ -2,6 +2,8 @@ package examples
import ( import (
"crypto/rsa" "crypto/rsa"
"errors"
"io"
"math/rand" "math/rand"
"net" "net"
"os" "os"
@@ -44,13 +46,15 @@ func sshagent() string {
} }
go func() { go func() {
for {
conn, err := l.Accept() conn, err := l.Accept()
if err != nil { if err != nil {
panic(err) panic(err)
} }
if err := agent.ServeAgent(a, conn); err != nil { if err := agent.ServeAgent(a, conn); err != nil && !errors.Is(err, io.EOF) {
panic(err) panic(err)
} }
}
}() }()
return sock return sock