2009-07-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Commented out throw statements when number of piece is 0 to
	download 0 length torrent.
	* src/bittorrent_helper.cc
pull/1/head
Tatsuhiro Tsujikawa 2009-07-04 15:39:20 +00:00
parent 24d258cf66
commit cafd23a068
2 changed files with 14 additions and 6 deletions

View File

@ -1,3 +1,9 @@
2009-07-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Commented out throw statements when number of piece is 0 to
download 0 length torrent.
* src/bittorrent_helper.cc
2009-07-05 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Call RequestGroup::createNextCommandWithAdj() from

View File

@ -345,13 +345,15 @@ static void processRootDictionary
throw DL_ABORT_EX(StringFormat(MSG_MISSING_BT_INFO,
C_PIECES.c_str()).str());
}
if(piecesData.s().empty()) {
throw DL_ABORT_EX("The length of piece hash is 0.");
}
// Commented out To download 0 length torrent.
// if(piecesData.s().empty()) {
// throw DL_ABORT_EX("The length of piece hash is 0.");
// }
size_t numPieces = piecesData.s().size()/PIECE_HASH_LENGTH;
if(numPieces == 0) {
throw DL_ABORT_EX("The number of pieces is 0.");
}
// Commented out to download 0 length torrent.
// if(numPieces == 0) {
// throw DL_ABORT_EX("The number of pieces is 0.");
// }
// retrieve piece length
const BDE& pieceLengthData = infoDict[C_PIECE_LENGTH];
if(!pieceLengthData.isInteger()) {