generate coding after indexing

This commit is contained in:
Stephen Akridge
2018-05-25 18:21:18 -07:00
committed by Greg Fitzgerald
parent ac7860c35d
commit 93b6fceb2f
2 changed files with 14 additions and 13 deletions

View File

@@ -378,15 +378,6 @@ fn broadcast(
}
let mut blobs = dq.into_iter().collect();
// appends codes to the list of blobs allowing us to reconstruct the stream
#[cfg(feature = "erasure")]
{
match erasure::generate_coding(recycler, &mut window.write().unwrap(), *transmit_index as usize) {
Err(_e) => { return Err(Error::GenericError) }
_ => {}
}
}
Crdt::index_blobs(crdt, &blobs, transmit_index)?;
// keep the cache of blobs that are broadcast
{
@@ -415,6 +406,15 @@ fn broadcast(
}
}
// appends codes to the list of blobs allowing us to reconstruct the stream
#[cfg(feature = "erasure")]
{
match erasure::generate_coding(recycler, &mut window.write().unwrap(), *transmit_index as usize) {
Err(_e) => { return Err(Error::GenericError) }
_ => {}
}
}
Crdt::broadcast(crdt, &window, &sock, transmit_index)?;
Ok(())
}