P2P: Cancel MA computations on client disconnect

This commit is contained in:
Vincent Bernardoff 2016-11-30 14:48:21 +01:00 committed by Grégoire Henry
parent 997d1972e0
commit 5f8b74e96c

View File

@ -494,7 +494,7 @@ module Make (P: PARAMS) = struct
let received = !counter in let received = !counter in
ma#add_int (received - old_received); ma#add_int (received - old_received);
inner received in inner received in
Lwt.async (fun () -> inner !counter) Lwt.async (fun () -> Lwt.pick [cancelation (); inner !counter])
in in
(* net object state *) (* net object state *)
let last = ref (Unix.gettimeofday ()) in let last = ref (Unix.gettimeofday ()) in