fixups
This commit is contained in:
@ -167,8 +167,9 @@ pub fn decode_blocks(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// Generate coding blocks in window starting from consumed,
|
||||
// for each block place the coding blobs at the end of the block
|
||||
// Generate coding blocks in window starting from start_idx,
|
||||
// for num_blobs.. For each block place the coding blobs
|
||||
// at the end of the block like so:
|
||||
//
|
||||
// block-size part of a Window, with each element a WindowSlot..
|
||||
// |<======================= NUM_DATA ==============================>|
|
||||
|
@ -328,7 +328,7 @@ fn process_blob(
|
||||
|
||||
// Search the window for old blobs in the window
|
||||
// of consumed to received and clear any old ones
|
||||
for ix in *consumed..(pix + 1) {
|
||||
for ix in *consumed..(received + 1) {
|
||||
let k = (ix % WINDOW_SIZE) as usize;
|
||||
|
||||
let mut old = false;
|
||||
@ -337,15 +337,16 @@ fn process_blob(
|
||||
}
|
||||
if old {
|
||||
if let Some(b) = mem::replace(&mut window[k].data, None) {
|
||||
debug!("{:x}: recycling data blob at index {:}", debug_id, k);
|
||||
recycler.recycle(b);
|
||||
}
|
||||
}
|
||||
let mut old = false;
|
||||
if let Some(b) = &window[k].coding {
|
||||
old = b.read().unwrap().get_index().unwrap() < *consumed;
|
||||
}
|
||||
if old {
|
||||
if let Some(b) = mem::replace(&mut window[k].coding, None) {
|
||||
debug!("{:x}: recycling coding blob at index {:}", debug_id, k);
|
||||
recycler.recycle(b);
|
||||
}
|
||||
}
|
||||
@ -394,6 +395,15 @@ fn process_blob(
|
||||
}
|
||||
}
|
||||
|
||||
// // Search the window for wrong data blobs...
|
||||
// for ix in *consumed..(received + 1) {
|
||||
// let k = (ix % WINDOW_SIZE) as usize;
|
||||
//
|
||||
// if let Some(b) = &window[k].data {
|
||||
// assert_eq!(ix, b.read().unwrap().get_index().unwrap());
|
||||
// }
|
||||
// }
|
||||
|
||||
// push all contiguous blobs into consumed queue, increment consumed
|
||||
while *consumed < received {
|
||||
let k = (*consumed % WINDOW_SIZE) as usize;
|
||||
|
Reference in New Issue
Block a user