/[mldonkey]/mldonkey/src/daemon/common/commonSwarming2.ml
ViewVC logotype

Diff of /mldonkey/src/daemon/common/commonSwarming2.ml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12 by spiralvoice, Thu Aug 4 21:45:24 2005 UTC revision 1.13 by spiralvoice, Sun Aug 7 12:57:21 2005 UTC
# Line 1107  let verify_chunk t i = Line 1107  let verify_chunk t i =
1107                end else begin                end else begin
1108    
1109                  if !verbose_swarming then                  if !verbose_swarming then
1110                      lprintf_nl () "VERIFICATION OF BLOCK %d OF %s FAILED"                      lprintf_nl () "Block %d of %s is corrupted !!"
1111                          i (file_best_name t.t_file);                          i (file_best_name t.t_file);
1112                  t.t_ncomplete_blocks <- t.t_ncomplete_blocks - 1;                  t.t_ncomplete_blocks <- t.t_ncomplete_blocks - 1;
1113    
# Line 1115  let verify_chunk t i = Line 1115  let verify_chunk t i =
1115                        s.s_verified_bitmap.[i] = '2'                        s.s_verified_bitmap.[i] = '2'
1116                    ) t.t_t2s_blocks.(i) then begin                    ) t.t_t2s_blocks.(i) then begin
1117    
1118                      lprintf_nl () "Verification of complete block %d of %s FAILED, redownloading it."                      lprintf_nl () "Complete block %d of %s is corrupted (wrong hash), block is being resetted."
1119                              i (file_best_name t.t_file);                              i (file_best_name t.t_file);
1120    
1121                      t.t_converted_verified_bitmap.[i] <- '0';                      t.t_converted_verified_bitmap.[i] <- '0';
# Line 1172  let verify_chunk t i = Line 1172  let verify_chunk t i =
1172    
1173                end else begin                end else begin
1174    
1175                  lprintf_nl () "VERIFICATION OF BLOCKS OF %s FAILED\n"                  lprintf_nl () "Verification of blocks for file %s FAILED\n"
1176                      (file_best_name t.t_file);                      (file_best_name t.t_file);
1177    
1178                    for i = 0 to nblocks - 1 do                    for i = 0 to nblocks - 1 do
# Line 1576  let chunks_to_string s chunks = Line 1576  let chunks_to_string s chunks =
1576            apply_intervals s (fun i block_begin block_end chunk_begin chunk_end -> st.[i] <- '1') chunks;            apply_intervals s (fun i block_begin block_end chunk_begin chunk_end -> st.[i] <- '1') chunks;
1577            st            st
1578          end          end
1579      | AvailableCharBitmap st -> st
1580      | AvailableCharBitmap st -> st    | AvailableBoolBitmap bitmap ->
1581          begin
1582      | AvailableBoolBitmap bitmap ->          let st = String.create (Array.length bitmap) in
1583          begin          for i = 0 to Array.length bitmap - 1 do
1584            let st = String.create (Array.length bitmap) in            st.[i] <- (if bitmap.(i) then '1' else '0')
1585            for i = 0 to Array.length bitmap - 1 do          done;
1586              st.[i] <- (if bitmap.(i) then '1' else '0')          st
1587            done;        end
           st  
         end  
1588    
1589  (*************************************************************************)  (*************************************************************************)
1590  (*                                                                       *)  (*                                                                       *)

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26