mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonUploads.m


From: mldonkey-commits
Subject: [Mldonkey-commits] Changes to mldonkey/src/daemon/common/commonUploads.ml
Date: Thu, 28 Jul 2005 18:46:18 -0400

Index: mldonkey/src/daemon/common/commonUploads.ml
diff -u mldonkey/src/daemon/common/commonUploads.ml:1.28 
mldonkey/src/daemon/common/commonUploads.ml:1.29
--- mldonkey/src/daemon/common/commonUploads.ml:1.28    Thu Jul 28 18:20:51 2005
+++ mldonkey/src/daemon/common/commonUploads.ml Thu Jul 28 22:46:17 2005
@@ -186,10 +186,6 @@
 
 let infos_by_name = Hashtbl.create 113
 
-let lprintf_nl () =
-  lprintf "%s[cUp] "
-    (log_time ()); lprintf_nl2
-
 let _ =
   set_after_load_hook shared_ini (fun _ ->
       List.iter (fun info ->
@@ -435,7 +431,7 @@
             CommonHasher.compute_sha1 (Unix32.filename sh.shared_fd)
             zero info.shared_size (fun job ->
                 if job.CommonHasher.job_error then begin
-                    lprintf_nl () "Error during hashing of %s" 
info.shared_fullname;
+                    lprintf_nl "[cUp] Error during hashing of %s" 
info.shared_fullname;
                     current_job := None;
                   end else
                   begin
@@ -524,7 +520,7 @@
                 pos (min (size -- pos) chunk_size)
               (fun job ->
                   if job.CommonHasher.job_error then begin
-                      lprintf_nl () "Error during hashing of %s" 
info.shared_fullname;
+                      lprintf_nl "[cUp] Error during hashing of %s" 
info.shared_fullname;
                       current_job := None;
                     end else begin
 
@@ -560,7 +556,7 @@
                   pos (min (size -- pos) chunk_size)
               (fun job ->
                     if job.CommonHasher.job_error then begin
-                      lprintf_nl () "Error during hashing of %s"
+                      lprintf_nl "[cUp] Error during hashing of %s"
                       info.shared_fullname;
                         current_job := None;
                       end else begin
@@ -597,7 +593,7 @@
             [] ->  waiting_shared_files := tail;
           | uid :: tail ->
               if !verbose_share then
-                lprintf_nl () "shared_files_timer: starting job";
+                lprintf_nl "[cUp] shared_files_timer: starting job";
               sh.shared_uids_wanted <- tail;
               current_job := Some sh;
               start_job_for sh uid
@@ -856,7 +852,7 @@
 
 let add_pending_slot c =
   if client_has_a_slot c then
-    if !verbose_upload then lprintf_nl () "Avoided inserting an uploader in 
pending slots!"
+    if !verbose_upload then lprintf_nl "[cUp] Avoided inserting an uploader in 
pending slots!"
   else
   if not (Intmap.mem (client_num c) !pending_slots_map) then
     begin
@@ -934,7 +930,7 @@
   let open_slots n =
     let i = ref n in
     if !verbose_upload then
-      lprintf_nl () "try to allocate %d more slots" n;
+      lprintf_nl "[cUp] try to allocate %d more slots" n;
     while !i > 0 do
       find_pending_slot ();
       decr i
@@ -945,7 +941,7 @@
 (*  let estimated_capacity = !!max_hard_upload_rate * 1024 in *)
   let estimated_capacity = detected_uplink_capacity () in
   if !verbose_upload then
-    lprintf_nl () "usage: %d(%d) capacity: %d"
+    lprintf_nl "[cUp] usage: %d(%d) capacity: %d"
       (short_delay_upload_usage ())
       (upload_usage ())
       estimated_capacity;
@@ -955,13 +951,13 @@
 (* enough free bw for another slot *)
     if short_delay_upload_usage () + slot_bw < estimated_capacity then begin
       if !verbose_upload then
-       lprintf_nl () "uplink not fully used";
+       lprintf_nl "[cUp] uplink not fully used";
       incr not_saturated_count
     end else reset_state ();
 
     if len < min_upload_slots then begin
       if !verbose_upload then
-       lprintf_nl () "too few upload slots";
+       lprintf_nl "[cUp] too few upload slots";
       open_slots (min_upload_slots - len);
       reset_state ()
     end else if !not_saturated_count >= 2 then begin
@@ -1043,10 +1039,10 @@
 let upload_download_timer () =
   (try download_engine ()
     with e ->
-        lprintf_nl () "Exception %s in download_engine" (Printexc2.to_string e)
+        lprintf_nl "[cUp] Exception %s in download_engine" 
(Printexc2.to_string e)
   );
   (try next_uploads ()
-  with e -> lprintf_nl () "exc %s in upload" (Printexc2.to_string e))
+  with e -> lprintf_nl "[cUp] exc %s in upload" (Printexc2.to_string e))
 
 let words_of_filename =
   let extension_list = [
@@ -1069,7 +1065,7 @@
   let get_name_keywords file_name =
     match remove_short (String2.stem file_name) [] with
       [] | [_] ->
-        lprintf_nl () "Not enough keywords to recover %s" file_name;
+        lprintf_nl "[cUp] Not enough keywords to recover %s" file_name;
         [file_name]
     | l -> l
   in




reply via email to

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