From 085e0572bc5ffd55dbb02fb942cc67fd8bb0b017 Mon Sep 17 00:00:00 2001 From: totoro Date: Wed, 22 May 2019 13:34:48 +0900 Subject: [PATCH] manage the raw_mode in receive of the file --- net_services/CXM_generic_protocol.anubis | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/net_services/CXM_generic_protocol.anubis b/net_services/CXM_generic_protocol.anubis index 9f6540c..9b6459f 100644 --- a/net_services/CXM_generic_protocol.anubis +++ b/net_services/CXM_generic_protocol.anubis @@ -217,11 +217,13 @@ public define Bool if (Maybe(RWStream))file(target_file, append) is { failure then println("can't create target file"+target_file);false, //nothing to write - success(target) then - if copy_file_to_Connection(mQ.get_connection(unique), file(target), size) is + success(target) then + with buffer = mQ.raw_mode_on(size), + forget(flush(buffer, weaken(target))); + if copy_file_to_Connection(mQ.get_connection(unique), file(target), size - length(buffer)) is { - failure then false, - success(_) then true + failure then mQ.raw_mode_off(unique);false, + success(_) then mQ.raw_mode_off(unique);true } } else //by default the mode is new -- libgit2 0.21.4