Skip to content

Commit

Permalink
immediate buffer release instead of defering
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMure committed Feb 27, 2020
1 parent 30ba05e commit fe2d21a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dht_net.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (dht *IpfsDHT) handleNewMessage(s network.Stream) bool {
var req pb.Message
msgbytes, err := r.ReadMsg()
if err != nil {
defer r.ReleaseMsg(msgbytes)
r.ReleaseMsg(msgbytes)
if err == io.EOF {
return true
}
Expand Down

0 comments on commit fe2d21a

Please sign in to comment.