summaryrefslogtreecommitdiff
path: root/src/CreateRequestCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-01-17 21:19:45 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-01-17 21:19:45 +0900
commitf2a63fa06a931333ac2e4a3a5d36a56418b4b6cd (patch)
tree1a9114f36cdb32cfd5e0272b672f0c8d5b420cde /src/CreateRequestCommand.cc
parent4824b09237e049ac7d912cdaa4a8a041eedd5dab (diff)
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.
Diffstat (limited to 'src/CreateRequestCommand.cc')
-rw-r--r--src/CreateRequestCommand.cc7
1 files changed, 7 insertions, 0 deletions
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 =