Fixes for erasure coding

This commit is contained in:
Stephen Akridge
2018-05-31 11:21:07 -07:00
committed by Greg Fitzgerald
parent 377d312c81
commit 33f01efe69
3 changed files with 82 additions and 28 deletions

View File

@@ -3,7 +3,7 @@
use crdt::Crdt;
#[cfg(feature = "erasure")]
use erasure;
use packet::{Blob, BlobRecycler, PacketRecycler, SharedBlob, SharedPackets, BLOB_SIZE};
use packet::{Blob, BlobRecycler, PacketRecycler, SharedBlob, SharedPackets, BLOB_SIZE, BLOB_FLAG_IS_CODING};
use result::{Error, Result};
use std::collections::VecDeque;
use std::net::{SocketAddr, UdpSocket};
@@ -290,6 +290,11 @@ fn recv_window(
if window[k].is_none() {
break;
}
let w_l1 = window[k].clone().unwrap();
let w_l2 = w_l1.read().unwrap();
if (w_l2.get_flags().unwrap() & BLOB_FLAG_IS_CODING) != 0 {
break;
}
contq.push_back(window[k].clone().expect("clone in fn recv_window"));
window[k] = None;
*consumed += 1;