Remove the really_write function and instead use Unixext.really_write.
Signed-off-by: John Else <john.else@citrix.com>
| Response x -> marshal_int 10 ^ (marshal_response x)
| Blob x -> marshal_int 11 ^ (marshal_blob_header x)
-let really_write (fd: Unix.file_descr) buf ofs len =
- if Unix.write fd buf ofs len <> len then raise End_of_file
-
let write_string (fd: Unix.file_descr) buf =
- really_write fd buf 0 (String.length buf)
+ Unixext.really_write fd buf 0 (String.length buf)
(** Marshal a message to a file descriptor prefixing it with total header length *)
let marshal (fd: Unix.file_descr) x =
let left = ref length in
while !left > 0 do
let n = Unix.read fd buffer 0 (min (String.length buffer) !left) in
- really_write ofd buffer 0 n;
+ Unixext.really_write ofd buffer 0 n;
left := !left - n
done;
marshal ofd (Blob End);
while not(!finished) do
let num = input ic buffer 0 (String.length buffer) in
begin try
- really_write fd buffer 0 num;
+ Unixext.really_write fd buffer 0 num;
with
Unix.Unix_error (a,b,c) ->
raise (ClientSideError (Printf.sprintf "%s: %s, %s." (Unix.error_message a) b c))