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 |
|
|
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'; |
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 |
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 |
(* *) |
(* *) |