diff -u mldonkey-2.8.1/debian/patches/00list mldonkey-2.8.1/debian/patches/00list --- mldonkey-2.8.1/debian/patches/00list +++ mldonkey-2.8.1/debian/patches/00list @@ -1,0 +2 @@ +avoid-duplicate-sending.dpatch diff -u mldonkey-2.8.1/debian/changelog mldonkey-2.8.1/debian/changelog --- mldonkey-2.8.1/debian/changelog +++ mldonkey-2.8.1/debian/changelog @@ -1,3 +1,14 @@ +mldonkey (2.8.1-1ubuntu0.1~proposed1) edgy-proposed; urgency=low + + * Add debian/patches/avoid-duplicate-sending.dpatch taken from + 2.8.1-2etch1, to avoid sending duplicate packages with + clients using rotational chunkrequests. Closes lp#83731. Thanks + to spiralvoice. + * SRU: lp#83731. + * Disable update-podebconf for SRU in debian/rules. + + -- Stefan Potyra Sat, 10 Mar 2007 00:25:57 +0000 + mldonkey (2.8.1-1) unstable; urgency=low * New upstream release, closes: #387977. diff -u mldonkey-2.8.1/debian/rules mldonkey-2.8.1/debian/rules --- mldonkey-2.8.1/debian/rules +++ mldonkey-2.8.1/debian/rules @@ -103,7 +103,7 @@ dh_testdir dh_testroot # Update the PO, as suggested in "man 7 po-debconf" - debconf-updatepo + #debconf-updatepo # Add here commands to clean up after the build process. $(MAKE) clean cd debian/xml-man && $(MAKE) clean only in patch2: unchanged: --- mldonkey-2.8.1.orig/debian/patches/avoid-duplicate-sending.dpatch +++ mldonkey-2.8.1/debian/patches/avoid-duplicate-sending.dpatch @@ -0,0 +1,141 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## avoid-duplicate-sending.dpatch by spiralvoice +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Avoid uploading data blocks twice to eMule clients. +## DP: See Debian bug #406247. + +@DPATCH@ +diff -urNad mldonkey-2.8.1~/src/networks/donkey/donkeyClient.ml mldonkey-2.8.1/src/networks/donkey/donkeyClient.ml +--- mldonkey-2.8.1~/src/networks/donkey/donkeyClient.ml 2006-09-05 14:18:24.000000000 +0000 ++++ mldonkey-2.8.1/src/networks/donkey/donkeyClient.ml 2007-01-13 11:27:35.000000000 +0000 +@@ -438,15 +438,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 +@@ -1989,13 +1991,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 + | _ -> +@@ -2004,6 +2014,7 @@ + up_pos = Int64.zero; + up_end_chunk = Int64.zero; + up_chunks = []; ++ up_flying_chunks = []; + up_waiting = false; + }, false + in +@@ -2091,12 +2102,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 -urNad mldonkey-2.8.1~/src/networks/donkey/donkeyFiles.ml mldonkey-2.8.1/src/networks/donkey/donkeyFiles.ml +--- mldonkey-2.8.1~/src/networks/donkey/donkeyFiles.ml 2006-05-19 23:43:54.000000000 +0000 ++++ mldonkey-2.8.1/src/networks/donkey/donkeyFiles.ml 2007-01-13 11:27:35.000000000 +0000 +@@ -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" max_len up.up_end_chunk; +- 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 = mini 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 -urNad mldonkey-2.8.1~/src/networks/donkey/donkeyTypes.ml mldonkey-2.8.1/src/networks/donkey/donkeyTypes.ml +--- mldonkey-2.8.1~/src/networks/donkey/donkeyTypes.ml 2006-09-05 14:18:24.000000000 +0000 ++++ mldonkey-2.8.1/src/networks/donkey/donkeyTypes.ml 2007-01-13 11:27:35.000000000 +0000 +@@ -569,6 +569,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; + } +