mirror of https://github.com/aria2/aria2
2009-02-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added _maxTries property to RequestGroup and assign the option value of PREF_MAX_TRIES to it. AbstractCommand now looks up RequestGroup::getMaxTries() instead of Option::getAsInt(PREF_MAX_TRIES). * src/AbstractCommand.cc * src/RequestGroup.cc * src/RequestGroup.hpull/1/head
parent
f16fb1c890
commit
1b26827851
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2009-02-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
|
Added _maxTries property to RequestGroup and assign the option
|
||||||
|
value of PREF_MAX_TRIES to it. AbstractCommand now looks up
|
||||||
|
RequestGroup::getMaxTries() instead of
|
||||||
|
Option::getAsInt(PREF_MAX_TRIES).
|
||||||
|
* src/AbstractCommand.cc
|
||||||
|
* src/RequestGroup.cc
|
||||||
|
* src/RequestGroup.h
|
||||||
|
|
||||||
2009-02-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
2009-02-01 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||||
|
|
||||||
Applied AdaptiveURISelector-timeout patch from Pascal Rigaux at
|
Applied AdaptiveURISelector-timeout patch from Pascal Rigaux at
|
||||||
|
|
|
@ -165,8 +165,8 @@ bool AbstractCommand::execute() {
|
||||||
logger->info(MSG_RESTARTING_DOWNLOAD, err, cuid, req->getUrl().c_str());
|
logger->info(MSG_RESTARTING_DOWNLOAD, err, cuid, req->getUrl().c_str());
|
||||||
req->addTryCount();
|
req->addTryCount();
|
||||||
req->resetRedirectCount();
|
req->resetRedirectCount();
|
||||||
bool isAbort = e->option->getAsInt(PREF_MAX_TRIES) != 0 &&
|
bool isAbort = _requestGroup->getMaxTries() != 0 &&
|
||||||
req->getTryCount() >= (unsigned int)e->option->getAsInt(PREF_MAX_TRIES);
|
req->getTryCount() >= _requestGroup->getMaxTries();
|
||||||
if(isAbort) {
|
if(isAbort) {
|
||||||
onAbort();
|
onAbort();
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,6 +127,7 @@ RequestGroup::RequestGroup(const Option* option,
|
||||||
_lastModifiedTime(Time::null()),
|
_lastModifiedTime(Time::null()),
|
||||||
_fileNotFoundCount(0),
|
_fileNotFoundCount(0),
|
||||||
_timeout(option->getAsInt(PREF_TIMEOUT)),
|
_timeout(option->getAsInt(PREF_TIMEOUT)),
|
||||||
|
_maxTries(option->getAsInt(PREF_MAX_TRIES)),
|
||||||
_inMemoryDownload(false),
|
_inMemoryDownload(false),
|
||||||
_option(option),
|
_option(option),
|
||||||
_logger(LogFactory::getInstance())
|
_logger(LogFactory::getInstance())
|
||||||
|
@ -1144,4 +1145,14 @@ time_t RequestGroup::getTimeout() const
|
||||||
return _timeout;
|
return _timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RequestGroup::setMaxTries(unsigned int maxTries)
|
||||||
|
{
|
||||||
|
_maxTries = maxTries;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int RequestGroup::getMaxTries() const
|
||||||
|
{
|
||||||
|
return _maxTries;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace aria2
|
} // namespace aria2
|
||||||
|
|
|
@ -137,6 +137,9 @@ private:
|
||||||
// Timeout used for HTTP/FTP downloads.
|
// Timeout used for HTTP/FTP downloads.
|
||||||
time_t _timeout;
|
time_t _timeout;
|
||||||
|
|
||||||
|
// How many times HTTP/FTP download should retry.
|
||||||
|
unsigned int _maxTries;
|
||||||
|
|
||||||
#ifdef ENABLE_BITTORRENT
|
#ifdef ENABLE_BITTORRENT
|
||||||
WeakHandle<BtRuntime> _btRuntime;
|
WeakHandle<BtRuntime> _btRuntime;
|
||||||
|
|
||||||
|
@ -431,6 +434,10 @@ public:
|
||||||
void setTimeout(time_t timeout);
|
void setTimeout(time_t timeout);
|
||||||
|
|
||||||
time_t getTimeout() const;
|
time_t getTimeout() const;
|
||||||
|
|
||||||
|
void setMaxTries(unsigned int maxTries);
|
||||||
|
|
||||||
|
unsigned int getMaxTries() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SharedHandle<RequestGroup> RequestGroupHandle;
|
typedef SharedHandle<RequestGroup> RequestGroupHandle;
|
||||||
|
|
Loading…
Reference in New Issue