indexing blobs then coding

This commit is contained in:
Stephen Akridge
2018-05-25 11:36:31 -07:00
committed by Greg Fitzgerald
parent b0eab8729f
commit ac7860c35d
2 changed files with 39 additions and 5 deletions

View File

@@ -377,6 +377,7 @@ fn broadcast(
dq.append(&mut nq);
}
let mut blobs = dq.into_iter().collect();
// appends codes to the list of blobs allowing us to reconstruct the stream
#[cfg(feature = "erasure")]
{
@@ -385,7 +386,8 @@ fn broadcast(
_ => {}
}
}
Crdt::broadcast(crdt, &blobs, &sock, transmit_index)?;
Crdt::index_blobs(crdt, &blobs, transmit_index)?;
// keep the cache of blobs that are broadcast
{
let mut win = window.write().unwrap();
@@ -412,6 +414,8 @@ fn broadcast(
win[pos] = Some(b);
}
}
Crdt::broadcast(crdt, &window, &sock, transmit_index)?;
Ok(())
}