Fixed bug: avoid integer overflow.

git-svn-id: http://yate.null.ro/svn/yate/trunk@4520 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2011-07-21 12:37:23 +00:00
parent 550e4408db
commit b2c923bc57
1 changed files with 2 additions and 2 deletions

View File

@ -474,7 +474,7 @@ void Cache::endLoad(bool triggerReload)
DDebug(&__plugin,DebugInfo,"Cache(%s) endLoad() [%p]",m_name.c_str(),this);
m_loading = false;
if (triggerReload)
m_nextLoad = m_loadInterval ? (Time::now() + m_loadInterval * 1000000) : 0;
m_nextLoad = m_loadInterval ? (Time::now() + (u_int64_t)m_loadInterval * 1000000) : 0;
}
// Copy params from cache item. Return true if found
@ -837,7 +837,7 @@ CacheItem* Cache::addUnsafe(const String& id, const NamedList& params, const Str
if (exp) {
int tmp = (int)exp->toInteger();
if (tmp > 0)
expires = Time::now() + tmp * 1000000;
expires = Time::now() + (u_int64_t)tmp * 1000000;
else {
XDebug(&__plugin,DebugAll,"Cache(%s) item '%s' already expired [%p]",
m_name.c_str(),id.c_str(),this);