mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 23:58:20 +00:00
This could be fixing the memory problems finally.
Keeping fingers crossed ...
This commit is contained in:
parent
c382439079
commit
c381da9ccf
1 changed files with 9 additions and 9 deletions
|
@ -73,14 +73,11 @@ void Manager::GetFds(int* read, int* write, int* except)
|
||||||
|
|
||||||
double Manager::NextTimestamp(double* network_time)
|
double Manager::NextTimestamp(double* network_time)
|
||||||
{
|
{
|
||||||
if ( ::network_time && ! next_beat )
|
|
||||||
next_beat = ::network_time + HEART_BEAT_INTERVAL;
|
|
||||||
|
|
||||||
// fprintf(stderr, "N %.6f %.6f did_process=%d next_next=%.6f\n", ::network_time, timer_mgr->Time(), (int)did_process, next_beat);
|
// fprintf(stderr, "N %.6f %.6f did_process=%d next_next=%.6f\n", ::network_time, timer_mgr->Time(), (int)did_process, next_beat);
|
||||||
|
|
||||||
if ( did_process || ::network_time > next_beat )
|
if ( did_process || ::network_time > next_beat || ! next_beat )
|
||||||
// If we had something to process last time (or out heartbeat
|
// If we had something to process last time (or out heartbeat
|
||||||
// is due), we want to check for more asap.
|
// is due or not set yet), we want to check for more asap.
|
||||||
return timer_mgr->Time();
|
return timer_mgr->Time();
|
||||||
|
|
||||||
return -1.0;
|
return -1.0;
|
||||||
|
@ -88,7 +85,13 @@ double Manager::NextTimestamp(double* network_time)
|
||||||
|
|
||||||
void Manager::Process()
|
void Manager::Process()
|
||||||
{
|
{
|
||||||
bool do_beat = (next_beat && network_time > next_beat);
|
bool do_beat = false;
|
||||||
|
|
||||||
|
if ( network_time && (network_time > next_beat || ! next_beat) )
|
||||||
|
{
|
||||||
|
do_beat = true;
|
||||||
|
next_beat = ::network_time + HEART_BEAT_INTERVAL;
|
||||||
|
}
|
||||||
|
|
||||||
did_process = false;
|
did_process = false;
|
||||||
|
|
||||||
|
@ -97,10 +100,7 @@ void Manager::Process()
|
||||||
MsgThread* t = *i;
|
MsgThread* t = *i;
|
||||||
|
|
||||||
if ( do_beat )
|
if ( do_beat )
|
||||||
{
|
|
||||||
t->Heartbeat();
|
t->Heartbeat();
|
||||||
next_beat = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while ( t->HasOut() )
|
while ( t->HasOut() )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue