Wait until buffer is empty when downloading

This commit is contained in:
ByteDream 2022-12-04 18:54:19 +01:00
parent 64717fd405
commit 7c3bbfc173

View file

@ -169,7 +169,7 @@ pub async fn download_segments(
data_pos += 1;
}
if *count.lock().unwrap() >= total_segments {
if *count.lock().unwrap() >= total_segments && buf.is_empty() {
break;
}
}