From e1e6bb1ec5a813c7e86343d4fdb451d18ac048f0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 8 Nov 2013 00:59:57 +0900 Subject: Don't fail multiple concurrent dl same file if auto-file-renaming is enabled --- src/HttpResponseCommand.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/HttpResponseCommand.cc') diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 3bda5e86..4c047a27 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -74,6 +74,7 @@ #include "uri.h" #include "SocketRecvBuffer.h" #include "MetalinkHttpEntry.h" +#include "NullProgressInfoFile.h" #ifdef ENABLE_MESSAGE_DIGEST # include "Checksum.h" # include "ChecksumCheckIntegrityEntry.h" @@ -258,11 +259,6 @@ bool HttpResponseCommand::executeInternal() } fe->setContentType(httpResponse->getContentType()); grp->preDownloadProcessing(); - if (getDownloadEngine()->getRequestGroupMan()->isSameFileBeingDownloaded(grp)) { - throw DOWNLOAD_FAILURE_EXCEPTION2(fmt(EX_DUPLICATE_FILE_DOWNLOAD, - grp->getFirstFilePath().c_str()), - error_code::DUPLICATE_DOWNLOAD); - } // update last modified time updateLastModifiedTime(httpResponse->getLastModifiedTime()); @@ -451,7 +447,7 @@ bool HttpResponseCommand::handleOtherEncoding( return true; } - getRequestGroup()->shouldCancelDownloadForSafety(); + getRequestGroup()->adjustFilename(std::make_shared()); getRequestGroup()->initPieceStorage(); getPieceStorage()->getDiskAdaptor()->initAndOpenFile(); -- cgit