mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] Changes to mldonkey/src/utils/lib/store.ml


From: mldonkey-commits
Subject: [Mldonkey-commits] Changes to mldonkey/src/utils/lib/store.ml
Date: Wed, 06 Jul 2005 20:25:54 -0400

Index: mldonkey/src/utils/lib/store.ml
diff -u mldonkey/src/utils/lib/store.ml:1.4 mldonkey/src/utils/lib/store.ml:1.5
--- mldonkey/src/utils/lib/store.ml:1.4 Thu Jul 29 10:25:34 2004
+++ mldonkey/src/utils/lib/store.ml     Thu Jul  7 00:25:46 2005
@@ -63,7 +63,7 @@
 let really_write fd pos s =
   let len = String.length s in
   if verbose then begin
-      lprintf "write %d %d" pos len; lprint_newline ();
+      lprintf_nl "write %d %d" pos len;
     end;
   ignore (seek64 fd  (Int64.of_int pos) Unix.SEEK_SET);
   iter_write fd s 0 len
@@ -75,7 +75,7 @@
   
 let really_read fd pos s len =
   if verbose then begin
-      lprintf "read %d %d" pos len; lprint_newline ();
+      lprintf_nl "read %d %d" pos len;
     end;
   ignore (seek64 fd  (Int64.of_int pos) Unix.SEEK_SET);
   iter_read fd s 0 len
@@ -108,7 +108,7 @@
       let new_weak = Weak.create new_size in
       (try Array.blit file.file_all_pos 0 new_tab 0 pos
         with e ->
-            lprintf "exc pos %d" pos; lprint_newline ();
+            lprintf_nl "exc pos %d" pos;
             raise e);
       Weak.blit file.file_cache 0 new_weak 0 pos;
       for i = pos to new_size - 1 do new_tab.(i) <- i+1; done;
@@ -170,9 +170,8 @@
   in
   let pos = file_store file str in
   if verbose then begin
-      lprintf "REALLY WRITE TO %d POS %d LEN %d"
+      lprintf_nl "REALLY WRITE TO %d POS %d LEN %d"
         chunk_size pos len;
-      lprint_newline ();
     end;
   Weak.set file.file_cache pos (Some v);
   let comb = combine pos chunk_size attr in
@@ -185,7 +184,7 @@
       let new_size = (len_all_doc + 10) * 2 in
       let new_tab = Array.create new_size 0 in
       (try Array.blit t.store_all_doc 0 new_tab 0 doc
-        with e -> lprintf "Error in blit %d/%d" doc len_all_doc; 
lprint_newline ();
+        with e -> lprintf_nl "Error in blit %d/%d" doc len_all_doc;
             raise e)
           ;
       for i = doc to new_size - 1 do new_tab.(i) <- i+1; done;
@@ -201,30 +200,28 @@
   let file = List.assoc chunk_size t.store_files in
   let v =  try Weak.get file.file_cache pos 
     with e ->
-        lprintf "Exception %s for doc at pos %d (doc %d, combine %d)" 
(Printexc2.to_string e)
-        pos doc combine; lprint_newline ();
+        lprintf_nl "Exception %s for doc at pos %d (doc %d, combine %d)" 
(Printexc2.to_string e)
+        pos doc combine;
         raise e
       in
   match v with
     None ->
       let len = file.file_entry_size in
       if verbose then begin
-          lprintf "REALLY READ FROM %d POS %d LEN %d"
+          lprintf_nl "REALLY READ FROM %d POS %d LEN %d"
             chunk_size pos len;
-          lprint_newline (); 
         end;
       let str = file_retrieve file pos in
       begin
         try
           Marshal.from_string str 0
         with e ->
-            lprintf "Marshal.from_string error"; 
-            lprint_newline (); raise e
+            lprintf_nl "Marshal.from_string error"; 
+            raise e
       end
   | Some v -> 
-      if verbose then begin
-          lprintf "Reply found in cache"; lprint_newline (); 
-        end;
+      if verbose then
+          lprintf_nl "Reply found in cache";
       v
 
       
@@ -275,4 +272,4 @@
         | Some _ -> incr counter;
       done;
   ) t.store_files;
-  !counter, Array.length t.store_all_doc
\ No newline at end of file
+  !counter, Array.length t.store_all_doc




reply via email to

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