mirror of https://github.com/aria2/aria2
2010-07-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Set milliseconds in DownloadEngine::refreshInterval_. Because there is difference in accuracy between epoll and clock_gettime(), we set DEFAULT_REFRESH_INTERVAL 900ms just lower than default timeout 1 sec for epoll. Also set update interval of ConsoleStatCalc to 900ms by the same reason. * src/ConsoleStatCalc.cc * src/DownloadEngine.cc * src/DownloadEngine.hpull/1/head
parent
27e96877b7
commit
a21e375baa
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2010-07-28 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Set milliseconds in DownloadEngine::refreshInterval_. Because
|
||||
there is difference in accuracy between epoll and clock_gettime(),
|
||||
we set DEFAULT_REFRESH_INTERVAL 900ms just lower than default
|
||||
timeout 1 sec for epoll. Also set update interval of
|
||||
ConsoleStatCalc to 900ms by the same reason.
|
||||
* src/ConsoleStatCalc.cc
|
||||
* src/DownloadEngine.cc
|
||||
* src/DownloadEngine.h
|
||||
|
||||
2010-07-27 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Rewritten check for fallocate using AC_COMPILE_IFELSE.
|
||||
|
|
|
@ -215,7 +215,7 @@ ConsoleStatCalc::ConsoleStatCalc(time_t summaryInterval, bool humanReadable):
|
|||
void
|
||||
ConsoleStatCalc::calculateStat(const DownloadEngine* e)
|
||||
{
|
||||
if(cp_.difference(global::wallclock) < 1) {
|
||||
if(cp_.differenceInMillis(global::wallclock) < 900) {
|
||||
return;
|
||||
}
|
||||
cp_ = global::wallclock;
|
||||
|
|
|
@ -143,7 +143,7 @@ void DownloadEngine::run()
|
|||
cp.reset(0);
|
||||
while(!commands_.empty() || !routineCommands_.empty()) {
|
||||
global::wallclock.reset();
|
||||
if(cp.difference(global::wallclock) >= refreshInterval_) {
|
||||
if(cp.differenceInMillis(global::wallclock) >= refreshInterval_) {
|
||||
refreshInterval_ = DEFAULT_REFRESH_INTERVAL;
|
||||
cp = global::wallclock;
|
||||
executeCommand(commands_, Command::STATUS_ALL);
|
||||
|
@ -529,7 +529,7 @@ void DownloadEngine::setAuthConfigFactory
|
|||
authConfigFactory_ = factory;
|
||||
}
|
||||
|
||||
void DownloadEngine::setRefreshInterval(time_t interval)
|
||||
void DownloadEngine::setRefreshInterval(int64_t interval)
|
||||
{
|
||||
refreshInterval_ = interval;
|
||||
}
|
||||
|
|
|
@ -123,9 +123,10 @@ private:
|
|||
|
||||
bool noWait_;
|
||||
|
||||
static const time_t DEFAULT_REFRESH_INTERVAL = 1;
|
||||
static const int64_t DEFAULT_REFRESH_INTERVAL = 900;
|
||||
|
||||
time_t refreshInterval_;
|
||||
// Milliseconds
|
||||
int64_t refreshInterval_;
|
||||
|
||||
std::deque<Command*> routineCommands_;
|
||||
|
||||
|
@ -337,7 +338,7 @@ public:
|
|||
return authConfigFactory_;
|
||||
}
|
||||
|
||||
void setRefreshInterval(time_t interval);
|
||||
void setRefreshInterval(int64_t interval);
|
||||
|
||||
const std::string getSessionId() const
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue