From 73b5fa677280bf223b38378d8db5fc374be75b5f Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Sun, 26 Mar 2023 11:14:16 +1100 Subject: [PATCH] fix the heartbeat bug --- rrqnet.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/rrqnet.c b/rrqnet.c index b06c3ab..82b524d 100644 --- a/rrqnet.c +++ b/rrqnet.c @@ -1806,11 +1806,13 @@ int main(int argc, char *argv[]) { pthread_create( &thread, 0, doreadTap, &tap_reader ); } - if ( heart_rate == 0 ) { - // Start heartbeating to uplinks - for ( ;; ) { + // Start heartbeating to uplinks + for ( ;; ) { + if ( heart_rate != 0 ) { sleep( heart_rate ); heartbeat( udp_fd ); + } else { + sleep( 600 ); } } return 0; -- 2.39.2