From fc29c6fca11b0f64a963c1368d2f4b56dae128fd Mon Sep 17 00:00:00 2001 From: Olivier 'reivilibre Date: Tue, 14 Jun 2022 19:57:14 +0100 Subject: [PATCH] Add some writer flushes that are probably necessary --- datman/src/commands/pushpull.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/datman/src/commands/pushpull.rs b/datman/src/commands/pushpull.rs index 25f71d1..2ea47ce 100644 --- a/datman/src/commands/pushpull.rs +++ b/datman/src/commands/pushpull.rs @@ -68,6 +68,7 @@ pub fn negotiate_bypassed_pile( write_message(writer, &my_full_pipeline)?; write_message(writer, &my_bypass_pipeline)?; + writer.flush()?; let their_full_pipeline = read_message::<_, Vec>(reader)?; let their_bypass_pipeline = read_message::<_, Vec>(reader)?; @@ -158,6 +159,7 @@ pub fn offering_side( } write_message(writer, &chunks_to_offer)?; + writer.flush()?; let chunks_to_skip: BTreeSet = read_message(reader)?; let chunks_to_send: Vec = chunks_to_offer @@ -179,6 +181,8 @@ pub fn offering_side( progress.inc_progress(1); } + writer.flush()?; + Ok(()) } @@ -209,6 +213,7 @@ pub fn accepting_side( } write_message(writer, &wanted_pointers)?; + writer.flush()?; let offered_chunks: BTreeSet = read_message(reader)?; let mut chunks_to_skip: BTreeSet = BTreeSet::new(); @@ -219,6 +224,7 @@ pub fn accepting_side( } write_message(writer, &chunks_to_skip)?; + writer.flush()?; let num_chunks_to_recv = offered_chunks.len() - chunks_to_skip.len(); @@ -248,6 +254,7 @@ pub fn accepting_side( for (pointer_name, pointer_data) in &offered_pointers { pile.write_pointer(pointer_name, pointer_data)?; } + pile.flush()?; Ok(()) }