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.
This commit is contained in:
		@@ -468,13 +468,14 @@ impl Blob {
 | 
				
			|||||||
            match Blob::recv_blob(socket, &r) {
 | 
					            match Blob::recv_blob(socket, &r) {
 | 
				
			||||||
                Err(_) if i > 0 => {
 | 
					                Err(_) if i > 0 => {
 | 
				
			||||||
                    trace!("got {:?} messages on {}", i, socket.local_addr().unwrap());
 | 
					                    trace!("got {:?} messages on {}", i, socket.local_addr().unwrap());
 | 
				
			||||||
 | 
					                    re.recycle(r, "Bob::recv_from::i>0");
 | 
				
			||||||
                    break;
 | 
					                    break;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                Err(e) => {
 | 
					                Err(e) => {
 | 
				
			||||||
                    if e.kind() != io::ErrorKind::WouldBlock {
 | 
					                    if e.kind() != io::ErrorKind::WouldBlock {
 | 
				
			||||||
                        info!("recv_from err {:?}", e);
 | 
					                        info!("recv_from err {:?}", e);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    re.recycle(r, "Blob::recv_from");
 | 
					                    re.recycle(r, "Blob::recv_from::empty");
 | 
				
			||||||
                    return Err(Error::IO(e));
 | 
					                    return Err(Error::IO(e));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                Ok(()) => if i == 0 {
 | 
					                Ok(()) => if i == 0 {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user