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:
parent
317c7d74ec
commit
7f2b2a5194
1 changed files with 3 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue