diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-05-15 23:35:06 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-05-15 23:35:06 +0900 |
| commit | 49b49c351ab0e5d464d158f2d103333371d9c42a (patch) | |
| tree | 835330b6def8caf42e92d68bd97343f4a7e87a9e /src/CreateRequestCommand.cc | |
| parent | 7d144913891c64ef1f01d5279b86066f8125f080 (diff) | |
Eliminated few seconds delay when downloads stop or pause.
The delay is caused because some Commands are only called in certain
interval(called refreshInterval, default, 1000ms). In aria2 download
stops when all Commands associated to it are stopped. Since some
Commands are called in each 1000ms by default, as mentioned before, we
have to wait for them. To fix this issue, we call
DownloadEngine::setRefreshInterval(0) when pausing/stopping downloads.
DownloadEngine::setRefreshInterval(0) makes refreshInterval 0 in one
shot.
When all segments are ignored, now DownloadFailureException is thrown.
And stop the download immediately. As described earlier, we call
DownloadEngine::setRefreshInterval(0) in catch block of
DownloadFailureException to eliminate delay.
Diffstat (limited to 'src/CreateRequestCommand.cc')
| -rw-r--r-- | src/CreateRequestCommand.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/CreateRequestCommand.cc b/src/CreateRequestCommand.cc index f731d91a..9fe997e6 100644 --- a/src/CreateRequestCommand.cc +++ b/src/CreateRequestCommand.cc @@ -94,7 +94,10 @@ bool CreateRequestCommand::executeInternal() if(getSegmentMan()) { getSegmentMan()->ignoreSegmentFor(getFileEntry()); } - throw DL_ABORT_EX("No URI available."); + // In this case, the error might be already set in RequestGroup, + // so use it here. + throw DL_ABORT_EX2("No URI available.", + getRequestGroup()->getLastErrorCode()); } else if(getRequest()->getWakeTime() > global::wallclock) { A2_LOG_DEBUG("This request object is still sleeping."); getFileEntry()->poolRequest(getRequest()); |
