[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/networks/bittorrent/bTChooser
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/networks/bittorrent/bTChooser.ml |
Date: |
Fri, 22 Jul 2005 10:32:27 -0400 |
Index: mldonkey/src/networks/bittorrent/bTChooser.ml
diff -u mldonkey/src/networks/bittorrent/bTChooser.ml:1.8
mldonkey/src/networks/bittorrent/bTChooser.ml:1.9
--- mldonkey/src/networks/bittorrent/bTChooser.ml:1.8 Sun Jul 10 23:19:16 2005
+++ mldonkey/src/networks/bittorrent/bTChooser.ml Fri Jul 22 14:32:12 2005
@@ -32,6 +32,15 @@
open BTOptions
open BTGlobals
+(* prints a new logline with date, module and starts newline *)
+let lprintf_nl () =
+ lprintf "%s[BT] "
+ (log_time ()); lprintf_nl2
+
+(* prints a new logline with date, module and does not start newline *)
+let lprintf_n () =
+ lprintf "%s[BT] "
+ (log_time ()); lprintf
(*given some files choose the next uploaders based on their behavior
Will choose max_uploaders_per_torrent uploaders for each file in list
@@ -58,7 +67,7 @@
possible_uploaders := (c::!possible_uploaders);
end ) f.file_clients;
if !verbose_upload then
- lprintf_nl "[BT]: clients num %d as possible uploaders for file
%s\n" (List.length !possible_uploaders) f.file_name;
+ lprintf_nl () "clients num %d as possible uploaders for file %s"
(List.length !possible_uploaders) f.file_name;
(*Interested clients with a connection*)
let filtl = List.filter (fun c -> c.client_interested == true
&& (c.client_sock != NoConnection)
@@ -82,12 +91,12 @@
full_list := !full_list @ to_add;
if !verbose_upload then
begin
- lprintf "[BT]: potential uploaders count: %d list: [" (List.length
to_add);
+ lprintf_n () "potential uploaders count: %d list: [" (List.length
to_add);
List.iter (fun cr ->
let (ip,port) = cr.client_host in
lprintf " %s:%d" (Ip.to_string ip) port;
) to_add;
- lprintf_nl " ]";
+ lprintf_nl2 " ]";
end;
) files;
@@ -131,24 +140,24 @@
begin
if !verbose_upload then
begin
- lprintf "[BT]: next_uploaders: %d list: [" (List.length
next_uploaders);
+ lprintf_n () "next_uploaders: %d list: [" (List.length
next_uploaders);
List.iter (fun cr ->
let (ip,port) = cr.client_host in
lprintf " %s:%d" (Ip.to_string ip) port;
) next_uploaders;
- lprintf_nl " ]";
+ lprintf_nl2 " ]";
end;
if (List.length next_uploaders) > !!max_bt_uploaders then
let keep,rest = List2.cut !!max_bt_uploaders next_uploaders in
begin
if !verbose_upload then
begin
- lprintf "[BT]: cut next_uploaders: %d list: [" (List.length
keep);
+ lprintf_n () "cut next_uploaders: %d list: [" (List.length
keep);
List.iter (fun cr ->
let (ip,port) = cr.client_host in
lprintf " %s:%d" (Ip.to_string ip) port;
) keep;
- lprintf_nl " ]";
+ lprintf_nl2 " ]";
end;
keep
end