1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

extra conn close

This commit is contained in:
Sergey Cherepanov 2024-04-25 11:36:17 +02:00
parent 317c7d74ec
commit 7f2b2a5194
No known key found for this signature in database
GPG key ID: 87F8EDE8FBDF637C

View file

@ -244,6 +244,9 @@ var defaultProtoChecker = handshake.ProtoChecker{
}
func (p *peer) serve(conn net.Conn) (err error) {
defer func() {
_ = conn.Close()
}()
hsCtx, cancel := context.WithTimeout(p.Context(), time.Second*20)
if _, err = handshake.IncomingProtoHandshake(hsCtx, conn, defaultProtoChecker); err != nil {
cancel()