/[mldonkey]/mldonkey/src/daemon/common/commonUploads.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/common/commonUploads.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.33 by spiralvoice, Thu Oct 6 19:16:43 2005 UTC revision 1.34 by spiralvoice, Sun Oct 16 20:42:50 2005 UTC
# Line 52  Default would be: share all files greate Line 52  Default would be: share all files greate
52    
53  *******************************************************************)  *******************************************************************)
54    
55  let ed2k_block_size = Int64.of_int 9728000  let ed2k_block_size = 9728000L
56  let tiger_block_size = Int64.of_int (1024 * 1024)  let tiger_block_size = Int64.of_int (1024 * 1024)
57    
58  type shared_file = {  type shared_file = {
# Line 502  computation ??? *) Line 502  computation ??? *)
502            try            try
503              let fd = Unix32.create_rw info.shared_fullname in              let fd = Unix32.create_rw info.shared_fullname in
504              let file_size = Unix32.getsize64 fd false in              let file_size = Unix32.getsize64 fd false in
505              let len64 = min (Int64.of_int 307200) file_size in              let len64 = min 307200L file_size in
506              let len = Int64.to_int len64 in              let len = Int64.to_int len64 in
507              let s = String.create len in              let s = String.create len in
508              Unix32.read fd zero s 0 len;              Unix32.read fd zero s 0 len;
# Line 704  let add_shared full_name codedname size Line 704  let add_shared full_name codedname size
704    
705        SharedFilesIndex.add sh.shared_info;        SharedFilesIndex.add sh.shared_info;
706        add_shared_file shared_tree sh (String2.split codedname '/');        add_shared_file shared_tree sh (String2.split codedname '/');
707        shared_counter := Int64.add !shared_counter size;        shared_counter := !shared_counter ++ size;
708  (*      lprintf "Total shared : %Ld\n" !shared_counter; *)  (*      lprintf "Total shared : %Ld\n" !shared_counter; *)
709        sh        sh
710    
# Line 1053  let _ = Line 1053  let _ =
1053        let total_uploaded = ref Int64.zero in        let total_uploaded = ref Int64.zero in
1054        S.shared_iter (fun s ->        S.shared_iter (fun s ->
1055            let i = S.as_shared_impl s in            let i = S.as_shared_impl s in
1056            total_uploaded :=            total_uploaded := !total_uploaded ++ i.S.impl_shared_uploaded;
1057            Int64.add !total_uploaded i.S.impl_shared_uploaded;            total_shared := !total_shared ++ i.S.impl_shared_size
           total_shared :=  
           Int64.add !total_shared i.S.impl_shared_size  
1058        );        );
1059        buf_int64 buf !total_shared;        buf_int64 buf !total_shared;
1060        buf_int64 buf !total_uploaded;        buf_int64 buf !total_uploaded;

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26