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
pull/1/head
Tatsuhiro Tsujikawa 2010-04-12 13:05:41 +00:00
parent b2c03934a8
commit 473d1ff6b5
4 changed files with 21 additions and 0 deletions

View File

@ -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.

View File

@ -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()) {

View File

@ -162,4 +162,9 @@ void Timer::advance(time_t sec)
_tv.tv_sec += sec;
}
bool Timer::monotonicClock()
{
return useClockGettime();
}
} // namespace aria2

View File

@ -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