mldonkey-tasks
[Top][All Lists]
Advanced

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

[Mldonkey-tasks] [task #5339] ED2K: Support for file's sizes >4GB


From: spiralvoice
Subject: [Mldonkey-tasks] [task #5339] ED2K: Support for file's sizes >4GB
Date: Fri, 17 Nov 2006 13:18:13 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; de; rv:1.8.0.7) Gecko/20060830 Firefox/1.5.0.7 (Debian-1.5.dfsg+1.5.0.7-2)

Follow-up Comment #9, task #5339 (project mldonkey):

Computation of filesize is wrong in your patch, at least for GETSOURCES.

>From eMule 0.47c

opcodes.h
=========
#define OLD_MAX_EMULE_FILE_SIZE 4290048000ui64  //
(4294967295/PARTSIZE)*PARTSIZE = ~4GB^

AbstractFile.h
==============
bool IsLargeFile() const { return m_nFileSize >
(uint64)OLD_MAX_EMULE_FILE_SIZE; }^

DownloadQueue.cpp, CDownloadQueue::ProcessLocalRequests
==========================================================
if (!cur_file->IsLargeFile()){^
        smPacket.WriteUInt32((uint32)(uint64)cur_file->GetFileSize());^
}^
else{^
        smPacket.WriteUInt32(0); // indicates that this is a large file and a 
uint64
follows^
        smPacket.WriteUInt64(cur_file->GetFileSize());^
}^

This means for large files the int64_32 filesize is 0 and the >4GB filesize
is sent afterwards. Getsources for smaller files is unchanged.
I removed the patch from donkeyProtoCom.ml completely and
added this to successfully receive sources from servers:

--- ././src/networks/donkey/donkeyProtoServer.ml        2006-11-14
19:42:59.000000000 +0100
+++ ././src/networks/donkey/donkeyProtoServer.ml        2006-11-17
14:11:05.000000000 +0100
@@ -830,7 +830,13 @@
       Printf.bprintf oc "QUERY LOCATION OF %s [%Ld]\n" (Md4.to_string t.md4)
t.size
 
     let write buf t =
-      buf_md4 buf t.md4; buf_int64_32 buf t.size 
+      buf_md4 buf t.md4;
+      if t.size > old_max_emule_file_size then
+        begin
+         buf_int64_32 buf 0L; buf_int64 buf t.size 
+        end
+      else
+        buf_int64_32 buf t.size 
   end
 
 module QueryLocationReply  = struct
--- ././src/networks/donkey/donkeyTypes.ml      2006-11-14 19:42:59.000000000
+0100
+++ ././src/networks/donkey/donkeyTypes.ml      2006-11-17 14:11:50.000000000
+0100
@@ -704,3 +708,5 @@
 
 let emule_proto () =
   { dummy_emule_proto with emule_version = 0 }
+
+let old_max_emule_file_size = 4290048000L


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?5339>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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