From 5641ac5b6b54d6d942fffbe3daf3af945665664e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 5 Nov 2007 15:50:49 +0000 Subject: 2007-11-06 Tatsuhiro Tsujikawa Fixed: Can not resume: aria2 reports download already finished. * src/AbstractCommand.{h, cc} * src/HttpResponseCommand.cc * src/FtpNegotiateCommand.cc --- src/HttpResponseCommand.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/HttpResponseCommand.cc') diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index fccaf648..dba8007f 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -48,6 +48,7 @@ #include "SingleFileDownloadContext.h" #include "DiskAdaptor.h" #include "PieceStorage.h" +#include "DefaultBtProgressInfoFile.h" #include #include @@ -130,8 +131,9 @@ bool HttpResponseCommand::handleDefaultEncoding(const HttpResponseHandle& httpRe return true; } + BtProgressInfoFileHandle infoFile = new DefaultBtProgressInfoFile(_requestGroup->getDownloadContext(), _requestGroup->getPieceStorage(), e->option); if(e->option->get(PREF_CHECK_INTEGRITY) != V_TRUE) { - if(downloadFinishedByFileLength()) { + if(!infoFile->exists() && downloadFinishedByFileLength()) { logger->notice(MSG_DOWNLOAD_ALREADY_COMPLETED, cuid, _requestGroup->getFilePath().c_str()); return true; } @@ -139,11 +141,11 @@ bool HttpResponseCommand::handleDefaultEncoding(const HttpResponseHandle& httpRe DownloadCommand* command = 0; try { + loadAndOpenFile(infoFile); File file(_requestGroup->getFilePath()); if(_requestGroup->getRemainingUris().empty() && !file.exists()) { command = createHttpDownloadCommand(httpResponse); } - loadAndOpenFile(); prepareForNextAction(command); e->noWait = true; } catch(Exception* e) { -- cgit