mldonkey-commits
[Top][All Lists]
Advanced

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

[Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...


From: mldonkey-commits
Subject: [Mldonkey-commits] mldonkey distrib/ChangeLog src/daemon/common/co...
Date: Thu, 19 Apr 2007 13:37:10 +0000

CVSROOT:        /sources/mldonkey
Module name:    mldonkey
Changes by:     spiralvoice <spiralvoice>       07/04/19 13:37:10

Modified files:
        distrib        : ChangeLog 
        src/daemon/common: commonSwarming.ml 

Log message:
        patch #5875

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/mldonkey/distrib/ChangeLog?cvsroot=mldonkey&r1=1.1235&r2=1.1236
http://cvs.savannah.gnu.org/viewcvs/mldonkey/src/daemon/common/commonSwarming.ml?cvsroot=mldonkey&r1=1.60&r2=1.61

Patches:
Index: distrib/ChangeLog
===================================================================
RCS file: /sources/mldonkey/mldonkey/distrib/ChangeLog,v
retrieving revision 1.1235
retrieving revision 1.1236
diff -u -b -r1.1235 -r1.1236
--- distrib/ChangeLog   19 Apr 2007 13:34:07 -0000      1.1235
+++ distrib/ChangeLog   19 Apr 2007 13:37:10 -0000      1.1236
@@ -15,6 +15,7 @@
 =========
 
 2007/04/19
+5875: Swarmer: Some cosmetic changes (pango)
 5856: EDK: Set TCP backlog to max_upload_slots for donkey_port socket
 5869: EDK/Swarmer: Try harder to read corrupt files.ini
 - reset chunk table to missing after re-creating a missing temp file

Index: src/daemon/common/commonSwarming.ml
===================================================================
RCS file: /sources/mldonkey/mldonkey/src/daemon/common/commonSwarming.ml,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -b -r1.60 -r1.61
--- src/daemon/common/commonSwarming.ml 19 Apr 2007 13:32:56 -0000      1.60
+++ src/daemon/common/commonSwarming.ml 19 Apr 2007 13:37:10 -0000      1.61
@@ -176,7 +176,7 @@
                                      or a balanced tree ? *)
     mutable block_remaining : int64; (* amount of bytes missing. *)
     mutable block_unselected_remaining : int64; (* same, less ranges
-                                                  selected by sources. *)
+                                                  selected for uploaders. *)
   }
 
 and range = {
@@ -249,7 +249,7 @@
    
 (* range owners are only used thru uploaders.up_ranges. blocks could be
    saved in [uploaders]' [up_ranges] along range, but would
-   need uploading when the swarmer is splitted.
+   need updating when the swarmer is splitted.
 
    Removing [range] from [up_ranges] and [range_nuploading] from
    [range] could be good too, because they're not correctly updated
@@ -530,6 +530,20 @@
   let r = b.block_ranges in
   r.range_next = None && r.range_begin = r.range_end
       
+(** iter function [f] over all the blocks contained in the list of [intervals]
+
+    [f] will receive block number, block beginning and ending offsets,
+    and overlapping interval beginning and ending offsets.
+
+    If an interval starts halfway of a block, iteration starts on the
+    next block, with interval_begin < block_begin indicating where the
+    interval really started.
+
+    If an interval ends halfway of a block, iteration ends on that
+    block, with interval_end < block_end indicating where the interval
+    really ended.
+*)
+
 let iter_intervals s f intervals =
   let nchunks = Array.length s.s_blocks in
   List.iter (fun (interval_begin, interval_end) ->
@@ -937,20 +951,6 @@
     Bitv.set s.s_disk_allocated disk_block true
   ) t interval_begin interval_end
 
-(** iter function f over all the blocks contained in the list of [intervals]
-
-    f with receive block number, block beginning and ending offsets,
-    and overlapping interval beginning and ending offsets.
-
-    If an interval starts halfway of a block, iteration starts on the
-    next block, with interval_begin < block_begin indicating where the
-    interval really started.
-
-    If an interval ends halfway of a block, iteration ends on that
-    block, with interval_end < block_end indicating where the interval
-    really ended.
-*)
-
 let check_finished t =
   let file = t.t_file in
   match file_state file with
@@ -1996,11 +1996,15 @@
   in
   iter_complete up
 
-(** Check whether block [n] of swarmer [s] is not completed yet,
-    calling chunk verification first if block still need verification *)
+(** Check whether block [n] of swarmer [s] is not already downloaded
+    and verified.
+
+    Chunk verification may be called if the block is completed but not
+    verified.
+*)
 
 let should_download_block s n =
-(*  lprintf "should_download_block %d\n" n; *)
+  (*  lprintf "should_download_block %d\n" n; *)
   let result =
     match VB.get s.s_verified_bitmap n with
     | VB.State_missing | VB.State_partial -> true
@@ -2290,7 +2294,8 @@
          Array2.subarray_fold_lefti (fun 
            ((current_chunk_num, current_chunk_blocks_indexes, 
            best_choices, specimen) as acc) n b ->
-           if not (should_download_block s b) then acc else
+           if not (should_download_block s b) then acc 
+           else
              let chunk_num = t.t_chunk_of_block.(b) in
              if chunk_num = current_chunk_num then
                (current_chunk_num, n :: current_chunk_blocks_indexes,




reply via email to

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