summaryrefslogtreecommitdiff
path: root/net-p2p/mldonkey/files
diff options
context:
space:
mode:
authorMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2007-02-10 09:13:39 +0000
committerMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2007-02-10 09:13:39 +0000
commit4ab78381c3fac2178b11ae21ae41a385dfc248cb (patch)
tree5f3f0fe1d2619a80ed4d87d579cf892ef1ccc7ad /net-p2p/mldonkey/files
parento Update to 2.8.2 cvs release as of date 2007021000 (diff)
o Fix: "Namely, eMule (and compatible) clients use 'rotational
chunkrequest' scheme, where each REQCHUNKS packet contains one new chunk and two older chunks. This can lead to duplicate data being sent by mldonkeys, if a rotational chunkrequest scheme is used when communicating with them." [1] http://hydranode.com/docs/ed2k/ed2kproto.php#upload o Bump PORTREVISION Submitted by: spiral voice <spiralvoice@hotmail.com> (MLDonkey developer) [1]
Notes
Notes: svn path=/head/; revision=184758
Diffstat (limited to 'net-p2p/mldonkey/files')
-rw-r--r--net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyClient.ml73
-rw-r--r--net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyFiles.ml46
-rw-r--r--net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyTypes.ml11
3 files changed, 130 insertions, 0 deletions
diff --git a/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyClient.ml b/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyClient.ml
new file mode 100644
index 000000000000..036af2d28f33
--- /dev/null
+++ b/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyClient.ml
@@ -0,0 +1,73 @@
+--- ./src/networks/donkey/donkeyClient.ml.orig Sun Nov 26 14:36:06 2006
++++ ./src/networks/donkey/donkeyClient.ml Sat Feb 10 07:00:40 2007
+@@ -442,15 +442,17 @@
+
+ let new_chunk up begin_pos end_pos =
+ if begin_pos <> end_pos then
+- let pair = (begin_pos, end_pos) in
+- (match up.up_chunks with
+- [] ->
++ let chunk = (begin_pos, end_pos) in
++ (* the zone requested is already "in the pipe" *)
++ if not (List.mem chunk up.up_flying_chunks) then
++ match up.up_chunks with
++ | [] ->
+ up.up_pos <- begin_pos;
+ up.up_end_chunk <- end_pos;
+- up.up_chunks <- [pair];
+- | chunks ->
+- if not (List.mem pair chunks) then
+- up.up_chunks <- chunks @ [pair])
++ up.up_chunks <- [chunk];
++ | up_chunks ->
++ if not (List.mem chunk up_chunks) then
++ up.up_chunks <- up_chunks @ [chunk]
+
+ let identify_client_brand c =
+ if c.client_brand = Brand_unknown then
+@@ -2039,13 +2041,21 @@
+ set_rtimeout sock !!upload_timeout;
+
+ let up, waiting = match c.client_upload with
+- Some ({ up_file = f } as up) when f == file -> up, up.up_waiting
++ | Some ({ up_file = f } as up) when f == file ->
++ (* zones are received in the order they're sent, so we
++ know that the oldest of the zones "in fly" must have
++ been received when this QueryBlockReq was sent *)
++ (match up.up_flying_chunks with
++ | [] -> ()
++ | _ :: q -> up.up_flying_chunks <- q);
++ up, up.up_waiting
+ | Some old_up ->
+ {
+ up_file = file;
+ up_pos = Int64.zero;
+ up_end_chunk = Int64.zero;
+ up_chunks = [];
++ up_flying_chunks = [];
+ up_waiting = old_up.up_waiting;
+ }, old_up.up_waiting
+ | _ ->
+@@ -2054,6 +2064,7 @@
+ up_pos = Int64.zero;
+ up_end_chunk = Int64.zero;
+ up_chunks = [];
++ up_flying_chunks = [];
+ up_waiting = false;
+ }, false
+ in
+@@ -2141,12 +2152,12 @@
+ let init_client sock c =
+ set_handler sock WRITE_DONE (fun s ->
+ match c.client_upload with
+- None -> ()
+- | Some up ->
++ | Some ({ up_chunks = _ :: _ } as up) ->
+ if not up.up_waiting && !CommonUploads.has_upload = 0 then begin
+ up.up_waiting <- true;
+ CommonUploads.ready_for_upload (as_client c)
+ end
++ | _ -> ()
+ );
+ (*
+ set_handler sock (BASIC_EVENT RTIMEOUT) (fun s ->
diff --git a/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyFiles.ml b/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyFiles.ml
new file mode 100644
index 000000000000..6b26cf734232
--- /dev/null
+++ b/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyFiles.ml
@@ -0,0 +1,46 @@
+--- ./src/networks/donkey/donkeyFiles.ml.orig Tue Nov 21 20:34:10 2006
++++ ./src/networks/donkey/donkeyFiles.ml Sat Feb 10 07:00:40 2007
+@@ -123,7 +123,7 @@
+ (* lprintf "send_client_block\n"; *)
+ if per_client > 0 && CommonUploads.can_write_len sock max_msg_size then
+ match c.client_upload with
+- | Some ({ up_chunks = _ :: chunks } as up) ->
++ | Some ({ up_chunks = current_chunk :: chunks } as up) ->
+ if up.up_file.file_shared = None then begin
+ (* Is there a message to warn that a file is not shared anymore ? *)
+ c.client_upload <- None;
+@@ -134,16 +134,17 @@
+ if max_len <= msg_block_size_int then
+ (* last block from chunk *)
+ begin
++ send_small_block c sock up.up_file up.up_pos max_len;
+ if !verbose_upload then
+ lprintf_nl "End of chunk (%d) %Ld %s" max_len up.up_end_chunk (file_best_name up.up_file);
+- send_small_block c sock up.up_file up.up_pos max_len;
++ up.up_flying_chunks <- up.up_flying_chunks @ [current_chunk];
+ up.up_chunks <- chunks;
+ let per_client = per_client - max_len in
+ match chunks with
+- [] ->
++ | [] ->
+ if !verbose_upload then
+- lprintf_nl "NO CHUNKS";
+- c.client_upload <- None;
++ lprintf_nl "NO MORE CHUNKS";
++ up.up_waiting <- false;
+ | (begin_pos, end_pos) :: _ ->
+ up.up_pos <- begin_pos;
+ up.up_end_chunk <- end_pos;
+@@ -168,10 +169,10 @@
+ let size = min max_msg_size size in
+ send_client_block c sock size;
+ (match c.client_upload with
+- None -> ()
+- | Some up ->
++ | Some ({ up_chunks = _ :: _ }) ->
+ if !CommonUploads.has_upload = 0 then
+ CommonUploads.ready_for_upload (as_client c)
++ | _ -> ()
+ )
+ )
+ let _ =
diff --git a/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyTypes.ml b/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyTypes.ml
new file mode 100644
index 000000000000..108ee5e11fab
--- /dev/null
+++ b/net-p2p/mldonkey/files/patch-src__networks__donkey__donkeyTypes.ml
@@ -0,0 +1,11 @@
+--- ./src/networks/donkey/donkeyTypes.ml.orig Sun Nov 26 14:36:06 2006
++++ ./src/networks/donkey/donkeyTypes.ml Sat Feb 10 07:00:40 2007
+@@ -602,6 +602,8 @@
+ mutable up_pos : int64;
+ mutable up_end_chunk : int64;
+ mutable up_chunks : (int64 * int64) list;
++ (* zones sent but not yet received by other peer, oldest first *)
++ mutable up_flying_chunks : (int64 * int64) list;
+ mutable up_waiting : bool;
+ }
+