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: Wed, 25 Jul 2007 19:27:10 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       07/07/25 19:27:10

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonComplexOptions.ml commonOptions.ml 
                           commonUploads.ml commonUserDb.ml 
        src/networks/bittorrent: bTClients.ml 
        src/networks/direct_connect: dcClients.ml 
        src/networks/donkey: donkeyFiles.ml 
        src/utils/lib  : options.ml4 options.mli 
        src/utils/net  : tcpBufferedSocket.ml tcpBufferedSocket.mli 
                         tcpServerSocket.ml 

Log message:
        patch #6087

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1303&r2=1.1304
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonComplexOptions.ml?cvsroot=mldonkey&r1=1.78&r2=1.79
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonOptions.ml?cvsroot=mldonkey&r1=1.211&r2=1.212
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonUploads.ml?cvsroot=mldonkey&r1=1.54&r2=1.55
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonUserDb.ml?cvsroot=mldonkey&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/bittorrent/bTClients.ml?cvsroot=mldonkey&r1=1.95&r2=1.96
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/direct_connect/dcClients.ml?cvsroot=mldonkey&r1=1.15&r2=1.16
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/networks/donkey/donkeyFiles.ml?cvsroot=mldonkey&r1=1.30&r2=1.31
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/options.ml4?cvsroot=mldonkey&r1=1.27&r2=1.28
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/lib/options.mli?cvsroot=mldonkey&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/net/tcpBufferedSocket.ml?cvsroot=mldonkey&r1=1.46&r2=1.47
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/net/tcpBufferedSocket.mli?cvsroot=mldonkey&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/utils/net/tcpServerSocket.ml?cvsroot=mldonkey&r1=1.10&r2=1.11

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1303
retrieving revision 1.1304
diff -u -b -r1.1303 -r1.1304
--- distrib/ChangeLog   25 Jul 2007 19:25:47 -0000      1.1303
+++ distrib/ChangeLog   25 Jul 2007 19:27:09 -0000      1.1304
@@ -15,6 +15,7 @@
 =========
 
 2007/07/25
+6087: Fix logging of verbosity "bw", remove obsolete options
 6085: BT: Improve UTF8 support
 - parse field "encoding"
 - use field "name.utf8" instead of "name", if available

Index: src/daemon/common/commonComplexOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonComplexOptions.ml,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -b -r1.78 -r1.79
--- src/daemon/common/commonComplexOptions.ml   30 Jun 2007 17:54:10 -0000      
1.78
+++ src/daemon/common/commonComplexOptions.ml   25 Jul 2007 19:27:09 -0000      
1.79
@@ -129,7 +129,7 @@
          let file_group =
            let dgroup = user2_print_user_default_group file_user in
            try
-             match (get_value "file_group" stringvalue_to_option) with
+             match (get_value "file_group" value_to_stringoption) with
                None -> None
              | Some g ->
                  begin
@@ -188,7 +188,7 @@
         ("file_age", IntValue (Int64.of_int impl.impl_file_age)) ::
         ("file_release", bool_to_value impl.impl_file_release) ::
         ("file_owner", string_to_value (file_owner file).user_name) ::
-        ("file_group", option_to_stringvalue (match file_group file with Some 
g -> Some g.group_name | None -> None)) ::
+        ("file_group", stringoption_to_value (match file_group file with Some 
g -> Some g.group_name | None -> None)) ::
           (file_to_option file)
         )
           

Index: src/daemon/common/commonOptions.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonOptions.ml,v
retrieving revision 1.211
retrieving revision 1.212
diff -u -b -r1.211 -r1.212
--- src/daemon/common/commonOptions.ml  9 Jul 2007 23:45:44 -0000       1.211
+++ src/daemon/common/commonOptions.ml  25 Jul 2007 19:27:09 -0000      1.212
@@ -1092,10 +1092,6 @@
   "The size of the MTU of a TCP/IP packet on your connection"
     int_option 1500
 
-let packet_frame_size = define_expert_option current_section 
["packet_frame_size"]
-  "The size of the frame packet on your network (on my cable link, it is 250)"
-    int_option 250
-
 let minimal_packet_size = define_expert_option current_section 
["minimal_packet_size"]
   "The size of the minimal packet you want mldonkey to send when data is
   available on the connection"
@@ -1388,10 +1384,6 @@
   "(experimental)" 
     int_option 0
 
-let use_result_history = define_expert_option current_section 
["use_file_history"]
-  "keep seen files in history to allow local search (can be expensive in 
memory)"
-    bool_option false
-
 let buffer_writes = define_option current_section ["buffer_writes"]
   "Buffer writes and flush after buffer_writes_delay seconds (experimental)"
     bool_option false
@@ -1807,9 +1799,6 @@
   option_hook minimal_packet_size (fun _ ->
       TcpBufferedSocket.minimal_packet_size := !!minimal_packet_size
   );
-  option_hook packet_frame_size (fun _ ->
-      TcpBufferedSocket.packet_frame_size := !!packet_frame_size
-  );
   option_hook minor_heap_size (fun _ ->
       let gc_control = Gc.get () in
       Gc.set { gc_control with Gc.minor_heap_size =

Index: src/daemon/common/commonUploads.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonUploads.ml,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -b -r1.54 -r1.55
--- src/daemon/common/commonUploads.ml  23 Apr 2007 23:40:28 -0000      1.54
+++ src/daemon/common/commonUploads.ml  25 Jul 2007 19:27:09 -0000      1.55
@@ -751,19 +751,6 @@
 let streaming_left = ref (streaming_amount ())
 let streaming_time = (ref None : float option ref)
 
-let can_write_len sock len =
-  let bool1 = can_write_len sock len in
-(* changed 2.5.24: Don't put in a socket more than 10 seconds of upload. *)
-(* ...since the socket shares available bandwidth with others, 
-   that test has no physical meaning. Should it simply be removed ? *)
-  let bool2 = not_buffer_more sock (int_of_float 
!CommonGlobals.payload_bandwidth * 10) in
-(*  lprintf "can_write_len %b %b\n" bool1 bool2; *)
-  let b = bool1 && bool2 in
-(*  if not b then
-      lprintf "bool1 %b len %d bool2 %b upload %d\n" 
-        bool1 len bool2 upload_rate; *)
-  b
-
 let next_uploads () =
 
   let rec next_uploads_aux () =

Index: src/daemon/common/commonUserDb.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonUserDb.ml,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- src/daemon/common/commonUserDb.ml   1 Jul 2007 12:58:54 -0000       1.11
+++ src/daemon/common/commonUserDb.ml   25 Jul 2007 19:27:09 -0000      1.12
@@ -200,7 +200,7 @@
           in
           let udgroup =
            try
-              match get_value "user_default_group" stringvalue_to_option with
+              match get_value "user_default_group" value_to_stringoption with
                None -> None
              | Some udg ->
                  begin try
@@ -233,7 +233,7 @@
         "user_name", string_to_value user.user_name;
         "user_pass", string_to_value (Md4.to_string user.user_pass);
        "user_groups", list_to_value (fun v -> string_to_value v.group_name) 
user.user_groups;
-        "user_default_group", option_to_stringvalue (match 
user.user_default_group with Some g -> Some g.group_name | None -> None);
+        "user_default_group", stringoption_to_value (match 
user.user_default_group with Some g -> Some g.group_name | None -> None);
         "user_mail", string_to_value user.user_mail;
         "user_commit_dir", string_to_value user.user_commit_dir;
         "user_max_concurrent_downloads", int_to_value 
user.user_max_concurrent_downloads;

Index: src/networks/bittorrent/bTClients.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/bittorrent/bTClients.ml,v
retrieving revision 1.95
retrieving revision 1.96
diff -u -b -r1.95 -r1.96
--- src/networks/bittorrent/bTClients.ml        17 Jun 2007 01:28:25 -0000      
1.95
+++ src/networks/bittorrent/bTClients.ml        25 Jul 2007 19:27:09 -0000      
1.96
@@ -1569,7 +1569,7 @@
       | _ :: tail ->
     let new_allowed_to_write =
       c.client_allowed_to_write ++ (Int64.of_int allowed) in
-      if allowed > 0 && CommonUploads.can_write_len sock
+      if allowed > 0 && can_write_len sock
             (Int64.to_int new_allowed_to_write)
       then begin
         CommonUploads.consume_bandwidth allowed;

Index: src/networks/direct_connect/dcClients.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/direct_connect/dcClients.ml,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -b -r1.15 -r1.16
--- src/networks/direct_connect/dcClients.ml    1 Jul 2007 12:57:03 -0000       
1.15
+++ src/networks/direct_connect/dcClients.ml    25 Jul 2007 19:27:09 -0000      
1.16
@@ -1497,7 +1497,7 @@
   (match c.client_sock with 
   | Connection sock ->
       (try
-        if (bytes > 0) && CommonUploads.can_write_len sock bytes then begin
+        if (bytes > 0) && can_write_len sock bytes then begin
           (* update upload rate from len bytes *)
           (*Rate.update c.client_upload_rate  (float_of_int len);*)
           (* update stats *)

Index: src/networks/donkey/donkeyFiles.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/networks/donkey/donkeyFiles.ml,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- src/networks/donkey/donkeyFiles.ml  23 Apr 2007 23:40:28 -0000      1.30
+++ src/networks/donkey/donkeyFiles.ml  25 Jul 2007 19:27:09 -0000      1.31
@@ -125,7 +125,7 @@
     
     let rec send_client_block c sock per_client =
 (*      lprintf "send_client_block\n"; *)
-      if per_client > 0 && CommonUploads.can_write_len sock max_msg_size then
+      if per_client > 0 && can_write_len sock max_msg_size then
         match c.client_upload with
         | Some ({ up_chunks = current_chunk :: chunks } as up)  ->
             if up.up_file.file_shared = None then begin

Index: src/utils/lib/options.ml4
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/options.ml4,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -b -r1.27 -r1.28
--- src/utils/lib/options.ml4   1 Jul 2007 13:00:13 -0000       1.27
+++ src/utils/lib/options.ml4   25 Jul 2007 19:27:09 -0000      1.28
@@ -485,12 +485,12 @@
 let ( !! ) o = o.option_value
 let ( =:= ) o v = o.option_value <- v; exec_chooks o; exec_hooks o
     
-let stringvalue_to_option v =
+let value_to_stringoption v =
   match v with
     StringValue s -> if s = "None" then None else Some s
   | _ -> failwith "Not a string option"
 
-let option_to_stringvalue v =
+let stringoption_to_value v =
   match v with
     None -> StringValue "None"
   | Some s -> StringValue s

Index: src/utils/lib/options.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/lib/options.mli,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- src/utils/lib/options.mli   1 Jul 2007 13:00:13 -0000       1.13
+++ src/utils/lib/options.mli   25 Jul 2007 19:27:10 -0000      1.14
@@ -158,8 +158,8 @@
 
 val value_to_string : option_value -> string
 val string_to_value : string -> option_value
-val option_to_stringvalue : string option -> option_value
-val stringvalue_to_option : option_value -> string option
+val stringoption_to_value : string option -> option_value
+val value_to_stringoption : option_value -> string option
 val value_to_int : option_value -> int
 val int_to_value : int -> option_value
 val value_to_int64 : option_value -> int64

Index: src/utils/net/tcpBufferedSocket.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/tcpBufferedSocket.ml,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- src/utils/net/tcpBufferedSocket.ml  4 Mar 2007 22:18:16 -0000       1.46
+++ src/utils/net/tcpBufferedSocket.ml  25 Jul 2007 19:27:10 -0000      1.47
@@ -229,17 +229,21 @@
 let unlimited_connection_manager = create_connection_manager "Unlimited"
 
 let reset_connection_scheduler _ =
-  if !verbose_bandwidth > 0 then begin
-      lprintf "[BW1 %6d] Connections opened this second : %d/%d total %d/%d\n"
-      (last_time ()) !opened_connections_this_second 
(!max_connections_per_second ()) !opened_connections (!max_opened_connections 
());
-    end;
+  if !verbose_bandwidth > 0 then
+    lprintf_nl "[BW1 %6d] Connections opened this second : %d/%d total %d/%d"
+      (last_time ())
+      !opened_connections_this_second
+      (!max_connections_per_second ())
+      !opened_connections
+      (!max_opened_connections ());
+
   List.iter (fun cm ->
       if !verbose_bandwidth > 0 then begin
           if cm.nconnections_last_second > 0 then
-            lprintf "[BW1 %6d]    %s opened %d connections last second\n"
+            lprintf_nl "[BW1 %6d]    %s opened %d connections last second"
               (last_time ()) cm.cm_name cm.nconnections_last_second;
           if cm.nwaiting_connections > 0 then
-            lprintf "[BW1 %6d]    %s still waits for %d connections\n"
+            lprintf_nl "[BW1 %6d]    %s still waits for %d connections"
               (last_time ()) cm.cm_name cm.nwaiting_connections;
        end;
       cm.nconnections_last_second <- 0;
@@ -539,11 +543,9 @@
           let fd = fd t.sock_out in
 (*       lprintf "WRITE [%s]\n" (String.escaped (String.sub s pos1 len)); *)
           let nw = MlUnix.write fd s pos1 len in
-          if !verbose_bandwidth > 1 then begin
-              lprintf "[BW2 %6d] immediate write %d/%d on %s:%d\n" (last_time 
())
-              nw len
-                t.name (sock_num t.sock_out);
-            end;
+          if !verbose_bandwidth > 1 then
+            lprintf_nl "[BW2 %6d] immediate write %d/%d on %s:%d"
+              (last_time ()) nw len t.name (sock_num t.sock_out);
 
           register_upload t len;
           forecast_download t 0;
@@ -670,17 +672,15 @@
       end;
 *)
 
-    if !verbose_bandwidth > 1 then begin
-        lprintf "[BW2 %6d] %sread %d/%d/%d on %s:%d\n" (last_time ())
+    if !verbose_bandwidth > 1 then
+      lprintf_nl "[BW2 %6d] %sread %d/%d/%d on %s:%d" (last_time ())
         (if old_len > 0 then "completing " else "") nread can_read max_len
           t.name (sock_num t.sock_in);
-      end;
 
 
-    if !copy_read_buffer then begin
-(*        lprintf "Copying %d bytes\n" nread; *)
+    if !copy_read_buffer then
         buf_add t b big_buffer 0 nread
-      end else
+    else
       b.len <- b.len + nread;
 (*    lprintf " %d\n" nread; *)
     b.min_buf_size <- min b.max_buf_size (
@@ -743,10 +743,10 @@
 (*            lprintf "WRITE [%s]\n" (String.escaped
               (String.sub b.buf b.pos max_len)); *)
             let nw = MlUnix.write fd b.buf b.pos max_len in
-            if !verbose_bandwidth > 1 then begin
-                lprintf "[BW2 %6d] postponed %swrite %d/%d/%d on %s:%d\n" 
(last_time ()) (if max_len < b.len then "partial " else "") nw max_len b.len
-                  t.name (sock_num t.sock_out);
-              end;
+            if !verbose_bandwidth > 1 then
+              lprintf_nl "[BW2 %6d] postponed %swrite %d/%d/%d on %s:%d"
+                  (last_time ()) (if max_len < b.len then "partial " else "")
+                  nw max_len b.len t.name (sock_num t.sock_out);
 
 (*            if t.monitored then
 (lprintf "written %d\n" nw; ); *)
@@ -920,10 +920,10 @@
       bc.remaining_bytes_user bc.total_bytes bc.remaining_bytes;
       bc.remaining_bytes <- bc.total_bytes - bc.forecast_bytes;
       if !verbose_bandwidth > 0 && bc.ndone_last_second > 0 then
-        lprintf "[BW1 %6d] %s read %d/%d last second\n" (last_time ())
+        lprintf_nl "[BW1 %6d] %s read %d/%d last second" (last_time ())
           bc.bc_name bc.ndone_last_second bc.total_bytes;
       if !verbose_bandwidth > 0 && bc.forecast_bytes > 0 then
-        lprintf "[BW1 %6d] %s forecast read %d bytes for next second\n" 
(last_time ())
+        lprintf_nl "[BW1 %6d] %s forecast read %d bytes for next second" 
(last_time ())
           bc.bc_name bc.forecast_bytes;
       bc.forecast_bytes <- 0;
       bc.ndone_last_second <- 0;
@@ -934,10 +934,10 @@
       bc.remaining_bytes_user bc.total_bytes bc.remaining_bytes;
       bc.remaining_bytes <- bc.total_bytes - bc.forecast_bytes;
       if !verbose_bandwidth > 0 && bc.ndone_last_second > 0 then
-        lprintf "[BW1 %6d] %s wrote %d/%d last second\n" (last_time ())
+        lprintf_nl "[BW1 %6d] %s wrote %d/%d last second" (last_time ())
           bc.bc_name bc.ndone_last_second bc.total_bytes;
       if !verbose_bandwidth > 0 && bc.forecast_bytes > 0 then
-        lprintf "[BW1 %6d] %s forecast write %d bytes for next second\n" 
(last_time ())
+        lprintf_nl "[BW1 %6d] %s forecast write %d bytes for next second" 
(last_time ())
           bc.bc_name bc.forecast_bytes;
       bc.forecast_bytes <- 0;
       bc.ndone_last_second <- 0;
@@ -1337,9 +1337,8 @@
       end;
     let t = create token name s handler in
 
-    if !verbose_bandwidth > 1 then begin
-        lprintf "[BW2 %6d] connect on %s:%d\n" (last_time ()) t.name (sock_num 
t.sock_out);
-      end;
+    if !verbose_bandwidth > 1 then
+      lprintf_nl "[BW2 %6d] connect on %s:%d" (last_time ()) t.name (sock_num 
t.sock_out);
 
     token.connection_manager.nconnections_last_second <-
       token.connection_manager.nconnections_last_second + 1;
@@ -1619,13 +1618,13 @@
           let old_value = !(bc.allow_io) in
           bc.allow_io := (bc.total_bytes = 0 || bc.remaining_bytes > 0);
           if !verbose_bandwidth > 2 && (old_value <> !(bc.allow_io)) then
-            lprintf "[BW3 %6d] %20s: stop reading\n" (last_time ()) bc.bc_name
+            lprintf_nl "[BW3 %6d] %20s: stop reading" (last_time ()) bc.bc_name
       ) !read_bandwidth_controlers;
       List.iter (fun bc ->
           let old_value = !(bc.allow_io) in
           bc.allow_io := (bc.total_bytes = 0 || bc.remaining_bytes > 0);
           if !verbose_bandwidth > 2 && (old_value <> !(bc.allow_io)) then
-            lprintf "[BW3 %6d] %20s: stop writting\n" (last_time ()) bc.bc_name
+            lprintf_nl "[BW3 %6d] %20s: stop writing" (last_time ()) bc.bc_name
       ) !write_bandwidth_controlers;
   );
 
@@ -1667,9 +1666,9 @@
               ) bc.connections;
 
               if !verbose_bandwidth > 2 && bc.nconnections > 0 then begin
-                  lprintf "[BW3 %6d] %d read-waiting connections for %d 
allowed\n" (last_time ()) bc.nconnections bc.remaining_bytes;
+                  lprintf_nl "[BW3 %6d] %d read-waiting connections for %d 
allowed" (last_time ()) bc.nconnections bc.remaining_bytes;
                   List.iter (fun t ->
-                      lprintf "[BW3 %6d]   %s:%d [buffered %d]\n" (last_time 
()) t.name (sock_num t.sock_in) ((buf t).len);
+                      lprintf_nl "[BW3 %6d]   %s:%d [buffered %d]" (last_time 
()) t.name (sock_num t.sock_in) ((buf t).len);
                   ) bc.connections;
                 end;
 
@@ -1689,10 +1688,9 @@
                     );
                     bc.nconnections <- bc.nconnections - t.read_power
                   else
-                  if !verbose_bandwidth > 2 then begin
-                      lprintf "[BW3 %6d]    %s:%d could not read\n" (last_time 
())
+                    if !verbose_bandwidth > 2 then
+                      lprintf_nl "[BW3 %6d]    %s:%d could not read" 
(last_time ())
                         t.name (sock_num t.sock_out)
-                    end
               ) bc.connections;
 (*              if bc.remaining_bytes > 0 then bc.allow_io := false; *)
             end;
@@ -1700,10 +1698,11 @@
           if !verbose_bandwidth > 2 then begin
 
               if bc.remaining_bytes > 0 then
-                lprintf "[BW3 %6d] still %d bytes to read\n" (last_time ()) 
bc.remaining_bytes;
+                lprintf_nl "[BW3 %6d] still %d bytes to read" (last_time ()) 
bc.remaining_bytes;
 
               if bc.nconnections > 0 then
-                lprintf "[BW3 %6d] still %d read-waiting connections after 
loop\n" (last_time ()) bc.nconnections;
+                lprintf_nl "[BW3 %6d] still %d read-waiting connections after 
loop"
+                  (last_time ()) bc.nconnections;
             end;
 
 
@@ -1720,9 +1719,11 @@
               ) bc.connections;
 
               if !verbose_bandwidth > 2 && bc.nconnections > 0 then begin
-                  lprintf "[BW3 %6d] %d write-waiting connections for %d 
allowed\n" (last_time ()) bc.nconnections bc.remaining_bytes;
+                  lprintf_nl "[BW3 %6d] %d write-waiting connections for %d 
allowed"
+                    (last_time ()) bc.nconnections bc.remaining_bytes;
                   List.iter (fun t ->
-                      lprintf "[BW3 %6d]   %s:%d [buffered %d]\n" (last_time 
()) t.name (sock_num t.sock_out) (remaining_to_write t);
+                      lprintf_nl "[BW3 %6d]   %s:%d [buffered %d]"
+                        (last_time ()) t.name (sock_num t.sock_out) 
(remaining_to_write t);
                   ) bc.connections;
                 end;
               List.iter (fun t ->
@@ -1740,27 +1741,28 @@
                     t.nwrite + old_nwrite;
                     bc.nconnections <- bc.nconnections - t.write_power;
                   else
-                  if !verbose_bandwidth > 2 then begin
-                      lprintf "[BW3 %6d]    %s:%d could not write buffered %d 
bytes\n" (last_time ())
-                        t.name (sock_num t.sock_out) (remaining_to_write t)
-                    end
+                  if !verbose_bandwidth > 2 then
+                    lprintf_nl "[BW3 %6d]    %s:%d could not write buffered %d 
bytes"
+                      (last_time ()) t.name (sock_num t.sock_out) 
(remaining_to_write t)
               ) bc.connections;
 (*            if bc.remaining_bytes > 0 then bc.allow_io := false; *)
             end;
           if !verbose_bandwidth > 2 then begin
 
               if bc.remaining_bytes > 0 then begin
-                  lprintf "[BW3 %6d] still %d bytes to write\n" (last_time ()) 
bc.remaining_bytes;
+                  lprintf_nl "[BW3 %6d] still %d bytes to write"
+                    (last_time ()) bc.remaining_bytes;
                   List.iter (fun t ->
                       let len = remaining_to_write t in
                       if len > 0 then
-                        lprintf "[BW3 %6d]    %s:%d could write %d\n" 
(last_time ())
+                        lprintf_nl "[BW3 %6d]    %s:%d could write %d" 
(last_time ())
                           t.name (sock_num t.sock_out) len
                   ) bc.connections
                 end;
 
               if bc.nconnections > 0 then
-                lprintf "[BW3 %6d] still %d write-waiting connections after 
loop\n" (last_time ()) bc.nconnections;
+                lprintf_nl "[BW3 %6d] still %d write-waiting connections after 
loop"
+                  (last_time ()) bc.nconnections;
             end;
           bc.connections <- [];
           bc.nconnections <- 0;
@@ -1774,60 +1776,9 @@
 let must_write t bool = must_write t.sock_out bool
 let output_buffered t = t.wbuf.len
 
-let net_stats = Hashtbl.create 13
-
-let join_stats titles values =
-  let titles = String2.split_simplify titles ' ' in
-  let values = String2.split_simplify values ' ' in
-  match titles, values with
-    title :: fields_titles, _ :: fields_values ->
-      List.iter2 (fun field_title field_value ->
-          let title = title ^ field_title in
-          let value = Int64.of_string field_value in
-          try
-            let old_value = Hashtbl.find net_stats title in
-            if !verbose_bandwidth > 0 && !old_value <> value then begin
-                lprintf "[BWS] %s: %Ld -> %Ld = %Ld/s\n"
-                  title !old_value value (value -- !old_value);
-              end;
-            old_value := value
-          with _ ->
-              Hashtbl.add net_stats title (ref value);
-              if !verbose_bandwidth > 0 then begin
-                  lprintf "[BWS] INIT %s: %Ld\n"
-                    title value
-              end;
-      ) fields_titles fields_values
-  | _ -> assert false
-
-let load_stats filename =
-  try
-    Unix2.tryopen_read filename (fun ic ->
-      try
-       let rec iter_first ic =
-         let titles = input_line ic in
-         iter_second ic titles
-       and iter_second ic titles =
-         let values = input_line ic in
-         join_stats titles values;
-         iter_first ic in
-       iter_first ic
-      with End_of_file -> ())
-  with e ->
-    lprintf "[BWS] Error %s opening %s\n" (Printexc2.to_string e) filename;
-    proc_net_fs := false
-
-let proc_net_timer _ =
-  if !proc_net_fs && !verbose_bandwidth > 0 then begin
-      load_stats "/proc/net/netstat";
-      load_stats "/proc/net/snmp";
-    end
-
-
 let _ =
   Heap.add_memstat "tcpBufferedSocket" (fun level buf ->
       Printf.bprintf buf "  %d latencies\n" (Hashtbl.length latencies);
-      Printf.bprintf buf "  %d entries in net_stats\n" (Hashtbl.length 
net_stats);
       Printf.bprintf buf "  String.length big_buffer: %d\n" (String.length 
big_buffer);
       Printf.bprintf buf "  connection_managers: %d\n" (List.length 
!connection_managers);
       Printf.bprintf buf "  read_bandwidth_controlers: %d\n" (List.length 
!read_bandwidth_controlers);
@@ -1836,7 +1787,4 @@
       Printf.bprintf buf "  max_opened_connections: %d\n" 
(!max_opened_connections ());
       Printf.bprintf buf "  max_connections_per_second: %d\n" 
(!max_connections_per_second ());
       Printf.bprintf buf "  max_buffer_size: %d\n" (!max_buffer_size);
-  );
-  add_infinite_timer 1.0 proc_net_timer
-
-let packet_frame_size = ref 250
+  )

Index: src/utils/net/tcpBufferedSocket.mli
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/tcpBufferedSocket.mli,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- src/utils/net/tcpBufferedSocket.mli 4 Mar 2007 22:18:16 -0000       1.17
+++ src/utils/net/tcpBufferedSocket.mli 25 Jul 2007 19:27:10 -0000      1.18
@@ -143,7 +143,6 @@
 val ip_packet_size : int ref
 val mtu_packet_size : int ref
 val minimal_packet_size : int ref
-val packet_frame_size : int ref
   
 val get_rtimeout : t -> float * float
   

Index: src/utils/net/tcpServerSocket.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/utils/net/tcpServerSocket.ml,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- src/utils/net/tcpServerSocket.ml    19 Apr 2007 13:34:07 -0000      1.10
+++ src/utils/net/tcpServerSocket.ml    25 Jul 2007 19:27:10 -0000      1.11
@@ -73,7 +73,7 @@
     begin
      try
       let s,id = Unix.accept (fd sock) in
-      if !verbose_bandwidth > 1 then lprintf "[BW2 %6d] accept on %s\n" 
(last_time ()) t.name;
+      if !verbose_bandwidth > 1 then lprintf_nl "[BW2 %6d] accept on %s" 
(last_time ()) t.name;
       (match t.accept_control with
           None -> () | Some cc -> 
             cc.nconnections_last_second <- cc.nconnections_last_second + 1);
@@ -135,10 +135,12 @@
       
       if !verbose_bandwidth > 0 then begin
           if !nconnections_last_second > 0 then
-            lprintf "[BW1 %6d] %d incoming connections last second:\n" 
(last_time ())  !nconnections_last_second;
+            lprintf_nl "[BW1 %6d] %d incoming connections last second:"
+              (last_time ())  !nconnections_last_second;
           List.iter (fun cc ->
               if cc.nconnections_last_second > 0 then
-                lprintf "[BW1 %6d]     %20s: %d incoming connections\n" 
(last_time ()) cc.cc_name cc.nconnections_last_second
+                lprintf_nl "[BW1 %6d]     %20s: %d incoming connections"
+                  (last_time ()) cc.cc_name cc.nconnections_last_second
           ) !connections_controlers
         end;
       




reply via email to

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