From 7b4b081ff4fb78cb15af04d02addf8a19519a151 Mon Sep 17 00:00:00 2001 From: Chen Kai <281165273grape@gmail.com> Date: Sat, 1 Jun 2024 08:20:47 +0800 Subject: [PATCH] Revert "fix: close conn after read" This reverts commit c6766840d46b9aa22736d83b3c8bf4566ef2cc4a. --- p2p/discover/portal_protocol.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/p2p/discover/portal_protocol.go b/p2p/discover/portal_protocol.go index a56f7e6dc8..229120502c 100644 --- a/p2p/discover/portal_protocol.go +++ b/p2p/discover/portal_protocol.go @@ -690,7 +690,6 @@ func (p *PortalProtocol) processContent(target *enode.Node, resp []byte) (byte, } // Read ALL the data from the connection until EOF and return it data, err := io.ReadAll(conn) - conn.Close() if err != nil { p.Log.Error("failed to read from utp connection", "err", err) return 0xff, nil, err @@ -1190,7 +1189,6 @@ func (p *PortalProtocol) handleOffer(id enode.ID, addr *net.UDPAddr, request *po // Read ALL the data from the connection until EOF and return it var data []byte data, err = io.ReadAll(conn) - conn.Close() if err != nil { p.Log.Error("failed to read from utp connection", "err", err) return