mldonkey-users
[Top][All Lists]
Advanced

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

Re: [Mldonkey-users] >2GB Bug again?


From: Martin
Subject: Re: [Mldonkey-users] >2GB Bug again?
Date: Sat, 15 Nov 2003 00:15:43 +0100
User-agent: Mutt

Pierre Etchemaite wrote...
>       http://ac-archive.sourceforge.net/largefile/
> It seems that at the very least, mldonkey's configure.in lacks a call to the
> AC_SYS_LARGEFILE macro...

? im not getting it...so is there a problem with the makefile?

im experimenting a little bit and extracted the last part of my big
file with 
# dd if=temp/MD4SUMOFTHATFILE of=testfile ibs=1 skip=2898944000 && md4sum 
testfile
> 126976+0 records in
> 248+0 records out
> 4b52777d788777fcff2b8018e506b14a

this gives me the correct md4sum just as its mentioned in mldonkeys
files.ini so the data on disc is correct

i then wrote a little ocaml-program that computes the hash of that
chunk directly out of my 2,7gig file (shamlessly copied from ed2k_hash)

open Md4
open LittleEndian
open Unix
open Printf2
let block_size = Int64.of_int 9728000
let _ =
  Arg.parse [] (fun filename ->
  let fd = Unix32.create filename [Unix.O_RDONLY] 0o666 in
  let file_size = Unix32.getsize64 filename in
  let i = 298 in
  let begin_pos = Int64.mul block_size (Int64.of_int i) in
  let end_pos = Int64.add begin_pos block_size in
  let end_pos = min end_pos file_size in
  let len = Int64.sub end_pos begin_pos in
  let md4 = Md4.digest_subfile fd begin_pos len in
  lprintf "Partial %3d\nLength %s\nStart %s\nEnd %s\nHash %s\n" i
  (Int64.to_string len) (Int64.to_string begin_pos)
  (Int64.to_string end_pos) (Md4.to_string md4);
) " <filenames> : compute hashes of filenames"

but this gives me a completely different hash!
> Your system supports 1024 file descriptors
> Partial 298
> Length 126976
> Start 2898944000
> End 2899070976
> Hash 499457092214A755B9148FA7BB8AAB35

and because mldonkey uses the same function to hash, nobody can
download anything >2GB! And even worse: all shared files >2GB will be
corrupted too!
Correct me if im wrong but i think the Md4.digest_subfile - function
is broken...so it must be an ocaml-bug? Or a compilation problem?
If its so we should at least disable sharing files >2gb to prevent
uploading corrupted data. And a little info to all mldonkey-users that
they got no chance to download a >2gb file would be nice....

-- 
Before replying see www.reedmedia.net/misc/mail/using-mailing-list.html
There are 2 ways to do it - my way and the right way




reply via email to

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