mirror of https://github.com/aria2/aria2
Fix busy loop with --dry-run and 4xx response for URI listed in metalink
See GH-430pull/454/head
parent
8fddf1bb7e
commit
7e3d82cb22
|
@ -48,6 +48,7 @@
|
|||
#include "SocketRecvBuffer.h"
|
||||
#include "LogFactory.h"
|
||||
#include "wallclock.h"
|
||||
#include "DownloadFailureException.h"
|
||||
|
||||
namespace aria2 {
|
||||
|
||||
|
@ -94,6 +95,13 @@ bool CreateRequestCommand::executeInternal()
|
|||
if(getSegmentMan()) {
|
||||
getSegmentMan()->ignoreSegmentFor(getFileEntry());
|
||||
}
|
||||
if(getOption()->getAsBool(PREF_DRY_RUN)) {
|
||||
// For dry run mode, just throwing DlAbortEx makes infinite
|
||||
// loop, since we don't have SegmentMan, and we cannot tell all
|
||||
// hopes were abandoned.
|
||||
throw DOWNLOAD_FAILURE_EXCEPTION2("No URI available.",
|
||||
getRequestGroup()->getLastErrorCode());
|
||||
}
|
||||
// In this case, the error might be already set in RequestGroup,
|
||||
// so use it here.
|
||||
throw DL_ABORT_EX2("No URI available.",
|
||||
|
|
Loading…
Reference in New Issue