Browse Source

2008-12-17 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Rename file by appending digits if a local file exists and its
	file size is larger than that of remote file with --continue
	option. The old implementation just throws exception in such
	case.
	* src/RequestGroup.cc
Tatsuhiro Tsujikawa 17 years ago
parent
commit
e9d648cb7b
2 changed files with 9 additions and 8 deletions
  1. 7 0
      ChangeLog
  2. 2 8
      src/RequestGroup.cc

+ 7 - 0
ChangeLog

@@ -1,3 +1,10 @@
+2008-12-17  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Rename file by appending digits if a local file exists and its
+	file size is larger than that of remote file with --continue
+	option. The old implementation just throws exception in such case.
+	* src/RequestGroup.cc
+
 2008-12-16  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Fixed the bug that download progress summary is not printed in the

+ 2 - 8
src/RequestGroup.cc

@@ -406,14 +406,8 @@ void RequestGroup::loadAndOpenFile(const BtProgressInfoFileHandle& progressInfoF
 	_pieceStorage->getDiskAdaptor()->openExistingFile();
       } else {
 	File outfile(getFilePath());    
-	if(outfile.exists() && _option->getAsBool(PREF_CONTINUE)) {
-	  if(getTotalLength() < outfile.size()) {
-	    throw DlAbortEx
-	      (StringFormat(EX_FILE_LENGTH_MISMATCH_BETWEEN_LOCAL_AND_REMOTE,
-			    getFilePath().c_str(),
-			    Util::itos(outfile.size()).c_str(),
-			    Util::itos(getTotalLength()).c_str()).str());
-	  }
+	if(outfile.exists() && _option->getAsBool(PREF_CONTINUE) &&
+	   outfile.size() <= getTotalLength()) {
 	  _pieceStorage->getDiskAdaptor()->openExistingFile();
 	  _pieceStorage->markPiecesDone(outfile.size());
 	} else {