immediate buffer release instead of defering

parent 30ba05e2
......@@ -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
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment