From f2a63fa06a931333ac2e4a3a5d36a56418b4b6cd Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 17 Jan 2011 21:19:45 +0900 Subject: Added --retry-wait option. This option was once existed in aria2 but erased on 2009-09-20. Now it is resurrected once again. We choose 2 as default value, but there is no good theory behind it. Now we retry HTTP download when remote server returns 503 Service Unavailable if --retry-wait > 0. We also added error code 29: HTTP_SERVICE_UNAVAILABLE. --- src/CreateRequestCommand.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/CreateRequestCommand.cc') diff --git a/src/CreateRequestCommand.cc b/src/CreateRequestCommand.cc index 3130b741..f731d91a 100644 --- a/src/CreateRequestCommand.cc +++ b/src/CreateRequestCommand.cc @@ -46,6 +46,8 @@ #include "RequestGroupMan.h" #include "FileEntry.h" #include "SocketRecvBuffer.h" +#include "LogFactory.h" +#include "wallclock.h" namespace aria2 { @@ -93,6 +95,11 @@ bool CreateRequestCommand::executeInternal() getSegmentMan()->ignoreSegmentFor(getFileEntry()); } throw DL_ABORT_EX("No URI available."); + } else if(getRequest()->getWakeTime() > global::wallclock) { + A2_LOG_DEBUG("This request object is still sleeping."); + getFileEntry()->poolRequest(getRequest()); + getDownloadEngine()->addCommand(this); + return false; } Command* command = -- cgit