mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...
Date: Fri, 06 Jan 2006 22:32:37 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Branch:         
Changes by:     spiralvoice <address@hidden>    06/01/06 22:32:36

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonOptions.ml 
        src/utils/net  : basicSocket.ml 

Log message:
        patch #4768

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/distrib/ChangeLog.diff?tr1=1.660&tr2=1.661&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/daemon/common/commonOptions.ml.diff?tr1=1.116&tr2=1.117&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/mldonkey/mldonkey/src/utils/net/basicSocket.ml.diff?tr1=1.28&tr2=1.29&r1=text&r2=text

Patches:
Index: mldonkey/distrib/ChangeLog
diff -u mldonkey/distrib/ChangeLog:1.660 mldonkey/distrib/ChangeLog:1.661
--- mldonkey/distrib/ChangeLog:1.660    Fri Jan  6 22:23:08 2006
+++ mldonkey/distrib/ChangeLog  Fri Jan  6 22:32:36 2006
@@ -12,6 +12,7 @@
 http://mldonkey.berlios.de/modules.php?name=Wiki&pagename=Windows
 
 2006/01/06
+4768: Dynamic loop delay (pango)
 4765: Add GeoIP.dat support (zet)
       GeoIP is a GPL database that maps IPs to countries.
       http://www.maxmind.com/download/geoip/database/
Index: mldonkey/src/daemon/common/commonOptions.ml
diff -u mldonkey/src/daemon/common/commonOptions.ml:1.116 
mldonkey/src/daemon/common/commonOptions.ml:1.117
--- mldonkey/src/daemon/common/commonOptions.ml:1.116   Fri Jan  6 22:23:09 2006
+++ mldonkey/src/daemon/common/commonOptions.ml Fri Jan  6 22:32:36 2006
@@ -505,7 +505,7 @@
   ["loop_delay"]
 "The delay in milliseconds to wait in the event loop. Can be decreased to
 increase the bandwidth usage, or increased to lower the CPU usage."
-  int_option 5
+  int_option 20
 
 let nolimit_ips = define_option current_section ["nolimit_ips"]
     ~desc: "No-limit IPs"
@@ -1467,7 +1467,7 @@
 
 let options_version = define_expert_option current_section ["options_version"]
     "(internal option)"
-    int_option 7
+    int_option 8
 
 
 (*************************************************************************)
@@ -1911,4 +1911,9 @@
       messages_filter =:= quote_unquote_bars !!messages_filter;
       update 7
 
+  | 7 ->
+      (* update to 20 because of dynamic_loop_delay patch *)
+      loop_delay =:= 20;
+      update 8
+
   | _ -> ()
Index: mldonkey/src/utils/net/basicSocket.ml
diff -u mldonkey/src/utils/net/basicSocket.ml:1.28 
mldonkey/src/utils/net/basicSocket.ml:1.29
--- mldonkey/src/utils/net/basicSocket.ml:1.28  Sat Dec 24 02:36:09 2005
+++ mldonkey/src/utils/net/basicSocket.ml       Fri Jan  6 22:32:36 2006
@@ -513,10 +513,17 @@
         lprintf_nl "[BW1] Resetting bandwidth counters";
       List.iter (fun f -> try f () with _ -> ()) !bandwidth_second_timers
   );
+  let loop_time = ref 0. in
   while true do
     try
-      if !loop_delay > 0. then (try select [] !loop_delay;  with _ -> ());
-      let _ = update_time () in
+      let time = 
+       let new_time = update_time () in
+       let dynamic_loop_delay =  !loop_time +. !loop_delay -. new_time in
+        if dynamic_loop_delay > 0. then begin
+         (try select [] dynamic_loop_delay;  with _ -> ());
+         update_time ()
+       end else new_time in
+      loop_time := time;
       exec_tasks !fd_tasks;
       exec_hooks !after_select_hooks;
       exec_timers !timers;




reply via email to

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