Do the easy check first
All functions above operate on immutable values, so this shouldn't change functionality, but no repair_window() tests to be certain.hI
This commit is contained in:
@ -122,6 +122,10 @@ fn repair_window(
|
|||||||
consumed: u64,
|
consumed: u64,
|
||||||
received: u64,
|
received: u64,
|
||||||
) -> Option<Vec<(SocketAddr, Vec<u8>)>> {
|
) -> Option<Vec<(SocketAddr, Vec<u8>)>> {
|
||||||
|
if received <= consumed {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
|
||||||
//exponential backoff
|
//exponential backoff
|
||||||
if !repair_backoff(last, times, consumed) {
|
if !repair_backoff(last, times, consumed) {
|
||||||
trace!("{} !repair_backoff() times = {}", id, times);
|
trace!("{} !repair_backoff() times = {}", id, times);
|
||||||
@ -134,10 +138,6 @@ fn repair_window(
|
|||||||
received,
|
received,
|
||||||
);
|
);
|
||||||
|
|
||||||
if received <= consumed {
|
|
||||||
return None;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut window = window.write().unwrap();
|
let mut window = window.write().unwrap();
|
||||||
let idxs = clear_window_slots(&mut window, recycler, consumed, highest_lost);
|
let idxs = clear_window_slots(&mut window, recycler, consumed, highest_lost);
|
||||||
let reqs: Vec<_> = idxs
|
let reqs: Vec<_> = idxs
|
||||||
|
Reference in New Issue
Block a user