From 1a4cd763f8ca630eb80e8906c09da78ba71a3059 Mon Sep 17 00:00:00 2001 From: sakridge Date: Thu, 13 Sep 2018 08:29:18 -0700 Subject: [PATCH] Fix missing recycle in recv_from (#1205) In the error case that i>0 (we have blobs to send) we break out of the loop and do not push the allocated r to the v array. We should recycle this blob, otherwise it will be dropped. --- src/packet.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/packet.rs b/src/packet.rs index 0b1f3184b4..4d3b262464 100644 --- a/src/packet.rs +++ b/src/packet.rs @@ -468,13 +468,14 @@ impl Blob { match Blob::recv_blob(socket, &r) { Err(_) if i > 0 => { trace!("got {:?} messages on {}", i, socket.local_addr().unwrap()); + re.recycle(r, "Bob::recv_from::i>0"); break; } Err(e) => { if e.kind() != io::ErrorKind::WouldBlock { info!("recv_from err {:?}", e); } - re.recycle(r, "Blob::recv_from"); + re.recycle(r, "Blob::recv_from::empty"); return Err(Error::IO(e)); } Ok(()) => if i == 0 {