fix off by one in packet.rs
This commit is contained in:
parent
5115cd7798
commit
dd819cec3d
|
@ -693,7 +693,7 @@ impl Crdt {
|
|||
v.debug_id(),
|
||||
);
|
||||
//TODO profile this, may need multiple sockets for par_iter
|
||||
assert!(rblob.meta.size < BLOB_SIZE);
|
||||
assert!(rblob.meta.size <= BLOB_SIZE);
|
||||
s.send_to(&rblob.data[..rblob.meta.size], &v.contact_info.tvu)
|
||||
})
|
||||
.collect();
|
||||
|
|
|
@ -280,7 +280,7 @@ pub fn to_blob<T: Serialize>(
|
|||
let mut b = blob.write().unwrap();
|
||||
let v = serialize(&resp)?;
|
||||
let len = v.len();
|
||||
assert!(len < BLOB_SIZE);
|
||||
assert!(len <= BLOB_SIZE);
|
||||
b.data[..len].copy_from_slice(&v);
|
||||
b.meta.size = len;
|
||||
b.meta.set_addr(&rsp_addr);
|
||||
|
|
|
@ -236,7 +236,7 @@ fn repair_window(
|
|||
"{:x}: repair_window request {} {} {}",
|
||||
debug_id, consumed, received, to
|
||||
);
|
||||
assert!(req.len() < BLOB_SIZE);
|
||||
assert!(req.len() <= BLOB_SIZE);
|
||||
sock.send_to(&req, to)?;
|
||||
}
|
||||
Ok(())
|
||||
|
|
Loading…
Reference in New Issue