Commit 085e0572bc5ffd55dbb02fb942cc67fd8bb0b017

Authored by David RENÉ
1 parent a927281b

manage the raw_mode in receive of the file

Showing 1 changed file with 6 additions and 4 deletions   Show diff stats
net_services/CXM_generic_protocol.anubis
@@ -217,11 +217,13 @@ public define Bool @@ -217,11 +217,13 @@ public define Bool
217 if (Maybe(RWStream))file(target_file, append) is 217 if (Maybe(RWStream))file(target_file, append) is
218 { 218 {
219 failure then println("can't create target file"+target_file);false, //nothing to write 219 failure then println("can't create target file"+target_file);false, //nothing to write
220 - success(target) then  
221 - if copy_file_to_Connection(mQ.get_connection(unique), file(target), size) is 220 + success(target) then
  221 + with buffer = mQ.raw_mode_on(size),
  222 + forget(flush(buffer, weaken(target)));
  223 + if copy_file_to_Connection(mQ.get_connection(unique), file(target), size - length(buffer)) is
222 { 224 {
223 - failure then false,  
224 - success(_) then true 225 + failure then mQ.raw_mode_off(unique);false,
  226 + success(_) then mQ.raw_mode_off(unique);true
225 } 227 }
226 } 228 }
227 else //by default the mode is new 229 else //by default the mode is new