Calculate piece hash when data is arrived if the data is arrived
in
order. This removes additional read operation for hash
calculation.
If the data is arrived in out of order, the hash is calucated
when the
piece is completed. This is the same behavior as the old
implementation.
* src/BtPieceMessage.cc
* src/DefaultBtProgressInfoFile.cc
* src/DefaultPieceStorage.cc
* src/DownloadCommand.cc
* src/DownloadCommand.h
* src/DownloadEngine.cc
* src/GrowSegment.cc
* src/GrowSegment.h
* src/Piece.cc
* src/Piece.h
* src/PiecedSegment.cc
* src/PiecedSegment.h
* src/Segment.h
* test/PieceTest.cc
* src/Piece.{h, cc}: Added SubPiece infrastructure to track down
the data smaller than block length.
A block length can be specified by constructor's argument.
* src/DefaultPieceStorage.{h, cc} (getMissingPiece):
Get a missing piece in the range of given FileEntry. This
function is
not used in the program yet.
* src/Util.h: Added some macros.