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 (
"crypto/rsa"
"errors"
"io"
"math/rand"
"net"
"os"
@@ -44,12 +46,14 @@ func sshagent() string {
}
go func() {
conn, err := l.Accept()
if err != nil {
panic(err)
}
if err := agent.ServeAgent(a, conn); err != nil {
panic(err)
for {
conn, err := l.Accept()
if err != nil {
panic(err)
}
if err := agent.ServeAgent(a, conn); err != nil && !errors.Is(err, io.EOF) {
panic(err)
}
}
}()