mldonkey-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Mldonkey-commits] mldonkey/src/daemon/common commonGlobals.ml


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey/src/daemon/common commonGlobals.ml
Date: Sat, 16 Sep 2006 15:36:09 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       06/09/16 15:36:09

Modified files:
        src/daemon/common: commonGlobals.ml 

Log message:
        patch #5395

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonGlobals.ml?cvsroot=mldonkey&r1=1.70&r2=1.71

Patches:
Index: commonGlobals.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonGlobals.ml,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -b -r1.70 -r1.71
--- commonGlobals.ml    16 Sep 2006 09:37:00 -0000      1.70
+++ commonGlobals.ml    16 Sep 2006 15:36:08 -0000      1.71
@@ -216,15 +216,18 @@
 let check_ul_dl_ratio () =
   if !!max_hard_upload_rate < 0 then max_hard_upload_rate =:= 0;
   if !!max_hard_download_rate < 0 then max_hard_download_rate =:= 0;
-  if !!max_hard_upload_rate < 4 && !!max_hard_upload_rate > 0 &&
-     (!!max_hard_upload_rate * 3 < !!max_hard_download_rate ||
-       !!max_hard_download_rate = 0) then
-      max_hard_download_rate =:= !!max_hard_upload_rate * 3
-  else
-    if !!max_hard_upload_rate < 10 && !!max_hard_upload_rate > 0 &&
-       (!!max_hard_upload_rate * 4 < !!max_hard_download_rate ||
-         !!max_hard_download_rate = 0) then
-         max_hard_download_rate =:= !!max_hard_upload_rate * 4
+  let max_max_hard_download_rate =
+    match !!max_hard_upload_rate with
+    | 0 -> None
+    | x when x < 4 -> Some (x * 3)
+    | x when x < 10 -> Some (x * 4)
+    | x -> None in
+  match max_max_hard_download_rate with
+  | None -> ()
+  | Some limit ->
+      if !!max_hard_download_rate = 0 ||
+       !!max_hard_download_rate > limit then
+         max_hard_download_rate =:= limit
 
 let _ =
   option_hook max_hard_upload_rate (fun _ ->




reply via email to

[Prev in Thread] Current Thread [Next in Thread]