Skip to content

Commit

Permalink
Revert "fix: close conn after read"
Browse files Browse the repository at this point in the history
This reverts commit c676684.
  • Loading branch information
GrapeBaBa committed Jun 1, 2024
1 parent 3a13371 commit 7b4b081
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions p2p/discover/portal_protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7b4b081

Please sign in to comment.