[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonInteracti
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonInteractive.ml |
Date: |
Tue, 06 Sep 2005 07:29:12 -0400 |
Index: mldonkey/src/daemon/common/commonInteractive.ml
diff -u mldonkey/src/daemon/common/commonInteractive.ml:1.47
mldonkey/src/daemon/common/commonInteractive.ml:1.48
--- mldonkey/src/daemon/common/commonInteractive.ml:1.47 Fri Sep 2
23:46:30 2005
+++ mldonkey/src/daemon/common/commonInteractive.ml Tue Sep 6 11:29:10 2005
@@ -369,6 +369,22 @@
with e ->
lprintf_nl "[cInt] Exception in contact_remove: %s" (Printexc2.to_string
e)
+let exit_counter = ref 0
+let exit_timer = ref false
+
+let rec clean_exit n =
+ let can_exit = networks_for_all (fun n -> network_clean_exit n) in
+ if can_exit || (!exit_counter > 3) then
+ exit_properly n
+ else
+ if not !exit_timer then begin
+ exit_timer := true;
+ add_timer 1. (fun _ ->
+ incr exit_counter;
+ exit_timer := false;
+ clean_exit n;
+ );
+ end
let time_of_sec sec =
let hours = sec / 60 / 60 in