diff options
author | wiz <wiz@pkgsrc.org> | 2007-01-13 18:41:32 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2007-01-13 18:41:32 +0000 |
commit | 54c132ee27f5ca34a1c6aeb0fb8cbb53b218370f (patch) | |
tree | 34250fa4da26aa0b5c960c0ee207a526d3e8a625 /net | |
parent | 30b3da0e2c8143f835025f27c13e6e6feb7949e8 (diff) | |
download | pkgsrc-54c132ee27f5ca34a1c6aeb0fb8cbb53b218370f.tar.gz |
Add (official) patch to fix following problem:
MLDonkey has a very serious bug which leeds to uploading
data blocks twice to eMule clients.
This is due to the fact that MLDonkey gets confused by
eMule rotating block request scheme.
http://hydranode.com/docs/ed2k/ed2kproto.php#upload
> 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.
More infos about it, including logs proving the problem, can be found here:
http://mldonkey.sourceforge.net/forums/viewtopic.php?t=4576
Bump PKGREVISION.
Diffstat (limited to 'net')
-rw-r--r-- | net/mldonkey/Makefile | 3 | ||||
-rw-r--r-- | net/mldonkey/distinfo | 5 | ||||
-rw-r--r-- | net/mldonkey/patches/patch-aa | 75 | ||||
-rw-r--r-- | net/mldonkey/patches/patch-ab | 48 | ||||
-rw-r--r-- | net/mldonkey/patches/patch-ac | 13 |
5 files changed, 142 insertions, 2 deletions
diff --git a/net/mldonkey/Makefile b/net/mldonkey/Makefile index 55a9dfece15..71f1283dd04 100644 --- a/net/mldonkey/Makefile +++ b/net/mldonkey/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.42 2006/09/16 06:21:39 wiz Exp $ +# $NetBSD: Makefile,v 1.43 2007/01/13 18:41:32 wiz Exp $ # .include "Makefile.common" +PKGREVISION= 1 RCD_SCRIPTS= mldonkey diff --git a/net/mldonkey/distinfo b/net/mldonkey/distinfo index 281cc64b184..105a890eba2 100644 --- a/net/mldonkey/distinfo +++ b/net/mldonkey/distinfo @@ -1,5 +1,8 @@ -$NetBSD: distinfo,v 1.33 2006/12/05 11:05:13 wiz Exp $ +$NetBSD: distinfo,v 1.34 2007/01/13 18:41:32 wiz Exp $ SHA1 (mldonkey-2.8.2.tar.bz2) = 510fad86b4c83b54a7e8836cec3a3f30d67aed8a RMD160 (mldonkey-2.8.2.tar.bz2) = ce95184805ac8f4c690e37c75d418b5f7e265f92 Size (mldonkey-2.8.2.tar.bz2) = 2652074 bytes +SHA1 (patch-aa) = 80045d742084ed024ddff515fee79a520c666c67 +SHA1 (patch-ab) = 0d0b0bd6b4c699ff0dbe69f07106b3a235223e67 +SHA1 (patch-ac) = 82b523066574f94ae238eaa7ba95e4823c41a49f diff --git a/net/mldonkey/patches/patch-aa b/net/mldonkey/patches/patch-aa new file mode 100644 index 00000000000..323e6fcd9fe --- /dev/null +++ b/net/mldonkey/patches/patch-aa @@ -0,0 +1,75 @@ +$NetBSD: patch-aa,v 1.13 2007/01/13 18:41:32 wiz Exp $ + +--- src/networks/donkey/donkeyClient.ml.orig 2006-11-26 16:36:29.000000000 +0000 ++++ src/networks/donkey/donkeyClient.ml +@@ -442,15 +442,17 @@ let client_wants_file c md4 = + + 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 @@ end else *) + 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 @@ end else *) + up_pos = Int64.zero; + up_end_chunk = Int64.zero; + up_chunks = []; ++ up_flying_chunks = []; + up_waiting = false; + }, false + in +@@ -2141,12 +2152,12 @@ make 1500 connections/10 minutes. *) + 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/mldonkey/patches/patch-ab b/net/mldonkey/patches/patch-ab new file mode 100644 index 00000000000..828931b6289 --- /dev/null +++ b/net/mldonkey/patches/patch-ab @@ -0,0 +1,48 @@ +$NetBSD: patch-ab,v 1.3 2007/01/13 18:41:32 wiz Exp $ + +--- src/networks/donkey/donkeyFiles.ml.orig 2006-11-21 22:34:33.000000000 +0000 ++++ src/networks/donkey/donkeyFiles.ml +@@ -123,7 +123,7 @@ module NewUpload = struct + (* 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 @@ module NewUpload = struct + 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 @@ module NewUpload = struct + 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/mldonkey/patches/patch-ac b/net/mldonkey/patches/patch-ac new file mode 100644 index 00000000000..a739f2f310b --- /dev/null +++ b/net/mldonkey/patches/patch-ac @@ -0,0 +1,13 @@ +$NetBSD: patch-ac,v 1.3 2007/01/13 18:41:32 wiz Exp $ + +--- src/networks/donkey/donkeyTypes.ml.orig 2006-11-26 16:36:29.000000000 +0000 ++++ src/networks/donkey/donkeyTypes.ml +@@ -602,6 +602,8 @@ and upload_info = { + 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; + } + |