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 = { |
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; |
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 |
|
|
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; |