Pārlūkot izejas kodu

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
Tatsuhiro Tsujikawa 16 gadi atpakaļ
vecāks
revīzija
cafd23a068
2 mainītis faili ar 14 papildinājumiem un 6 dzēšanām
  1. 6 0
      ChangeLog
  2. 8 6
      src/bittorrent_helper.cc

+ 6 - 0
ChangeLog

@@ -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>
 2009-07-05  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 
 	Call RequestGroup::createNextCommandWithAdj() from
 	Call RequestGroup::createNextCommandWithAdj() from

+ 8 - 6
src/bittorrent_helper.cc

@@ -345,13 +345,15 @@ static void processRootDictionary
     throw DL_ABORT_EX(StringFormat(MSG_MISSING_BT_INFO,
     throw DL_ABORT_EX(StringFormat(MSG_MISSING_BT_INFO,
 				   C_PIECES.c_str()).str());
 				   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;
   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
   // retrieve piece length
   const BDE& pieceLengthData = infoDict[C_PIECE_LENGTH];
   const BDE& pieceLengthData = infoDict[C_PIECE_LENGTH];
   if(!pieceLengthData.isInteger()) {
   if(!pieceLengthData.isInteger()) {