mirror of https://github.com/aria2/aria2
2010-04-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added warning for the system which lacks clock_gettime with CLOCK_MONOTONIC. * src/MultiUrlRequestInfo.cc * src/TimerA2.cc * src/TimerA2.hpull/1/head
parent
b2c03934a8
commit
473d1ff6b5
|
@ -1,3 +1,11 @@
|
|||
2010-04-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Added warning for the system which lacks clock_gettime with
|
||||
CLOCK_MONOTONIC.
|
||||
* src/MultiUrlRequestInfo.cc
|
||||
* src/TimerA2.cc
|
||||
* src/TimerA2.h
|
||||
|
||||
2010-04-12 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
|
||||
|
||||
Removed redundant method call for DownloadEngine.
|
||||
|
|
|
@ -158,6 +158,10 @@ downloadresultcode::RESULT MultiUrlRequestInfo::execute()
|
|||
}
|
||||
SocketCore::setTLSContext(tlsContext);
|
||||
#endif
|
||||
if(!Timer::monotonicClock()) {
|
||||
_logger->warn("Don't change system time while aria2c is running."
|
||||
" Doing this may make aria2c hang for long time.");
|
||||
}
|
||||
|
||||
std::string serverStatIf = _option->get(PREF_SERVER_STAT_IF);
|
||||
if(!serverStatIf.empty()) {
|
||||
|
|
|
@ -162,4 +162,9 @@ void Timer::advance(time_t sec)
|
|||
_tv.tv_sec += sec;
|
||||
}
|
||||
|
||||
bool Timer::monotonicClock()
|
||||
{
|
||||
return useClockGettime();
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
|
@ -94,6 +94,10 @@ public:
|
|||
int64_t getTimeInMicros() const;
|
||||
|
||||
int64_t getTimeInMillis() const;
|
||||
|
||||
// Returns true if this Timer is not affected by system time change.
|
||||
// Otherwise return false.
|
||||
static bool monotonicClock();
|
||||
};
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Reference in New Issue