From f2213d05c73a4e10cf9908c2488aafb934a51d61 Mon Sep 17 00:00:00 2001 From: ehouse Date: Wed, 19 Oct 2005 03:42:17 +0000 Subject: [PATCH] don't track heartbeat independent of any timers set. This allows infinite timeout when no devices present. --- relay/timermgr.cpp | 8 ++++---- relay/timermgr.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/relay/timermgr.cpp b/relay/timermgr.cpp index 2b634e928..d2f9a262f 100644 --- a/relay/timermgr.cpp +++ b/relay/timermgr.cpp @@ -29,7 +29,6 @@ TimerMgr::TimerMgr() : m_nextFireTime(0) - , m_heartbeat(RelayConfigs::GetConfigs()->GetHeartbeatInterval() ) { pthread_mutex_init( &m_timersMutex, NULL ); } @@ -74,15 +73,16 @@ TimerMgr::GetPollTimeout() time_t tout = m_nextFireTime; if ( tout == 0 ) { - tout = m_heartbeat; + tout = -1; } else { tout -= now(); if ( tout < 0 ) { tout = 0; } + tout *= 1000; } - return tout * 1000; -} + return tout; +} /* GetPollTimeout */ int TimerMgr::getTimer( TimerProc proc, void* closure ) diff --git a/relay/timermgr.h b/relay/timermgr.h index 263ddbd59..389195583 100644 --- a/relay/timermgr.h +++ b/relay/timermgr.h @@ -64,7 +64,6 @@ class TimerMgr { list m_timers; time_t m_nextFireTime; - time_t m_heartbeat; }; #endif