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
pull/1/head
Tatsuhiro Tsujikawa 2008-12-16 15:13:47 +00:00
parent 22d91f1729
commit e9d648cb7b
2 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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 {