summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-05-25 01:35:30 +0200
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-05-25 01:35:30 +0200
commit101ab9ca8c3e026592f648de202f8f2b62644474 (patch)
treeb3acefe5d5201a7b45d4dd916c95bb69da3e5a81
parent8109ab47f06c12b1ca1317d0077b88094ce11464 (diff)
downloadSystemeReseaux-Projet-101ab9ca8c3e026592f648de202f8f2b62644474.tar.gz
SystemeReseaux-Projet-101ab9ca8c3e026592f648de202f8f2b62644474.zip
Compatibility
-rw-r--r--src/example.ml2
-rw-r--r--src/poolclient.ml13
-rw-r--r--src/util.ml5
3 files changed, 13 insertions, 7 deletions
diff --git a/src/example.ml b/src/example.ml
index 7b6f23e..2aade1f 100644
--- a/src/example.ml
+++ b/src/example.ml
@@ -76,7 +76,7 @@ module Example (K : Kahn.S) = struct
let main2 : int K.process =
(delay K.new_channel()) >>=
(fun (qi, qo) ->
- (fib_rec 50 7 qo) >>=
+ (fib_rec 53 7 qo) >>=
(fun () -> K.get qi))
end
diff --git a/src/poolclient.ml b/src/poolclient.ml
index 00b0d35..b6d5a89 100644
--- a/src/poolclient.ml
+++ b/src/poolclient.ml
@@ -10,11 +10,14 @@ let fullfill_request task (addr, port) n =
for i = 0 to n-1 do
Format.eprintf "Spawn %s@." task;
if fork() = 0 then begin
- let sock = socket PF_INET SOCK_STREAM 0 in
- connect sock (make_addr addr port);
- dup2 sock stdin;
- dup2 sock stdout;
- execv task [|task|]
+ try
+ let sock = socket PF_INET SOCK_STREAM 0 in
+ connect sock (make_addr addr port);
+ dup2 sock stdin;
+ dup2 sock stdout;
+ execv task [|task|]
+ with
+ | _ -> exit 0
end
done
diff --git a/src/util.ml b/src/util.ml
index 5155fd7..b37ae4f 100644
--- a/src/util.ml
+++ b/src/util.ml
@@ -18,5 +18,8 @@ let read_one_msg fd =
assert (read fd hdr 0 Marshal.header_size = Marshal.header_size);
let dlen = Marshal.data_size hdr 0 in
let data = String.create dlen in
- assert (read fd data 0 dlen = dlen);
+ let rl = ref 0 in
+ while !rl < dlen do
+ rl := !rl + read fd data !rl (dlen - !rl)
+ done;
Marshal.from_string (hdr ^ data) 0