From: Ralph Ronnquist Date: Sun, 26 Mar 2023 00:14:16 +0000 (+1100) Subject: fix the heartbeat bug X-Git-Tag: 1.6.2~2 X-Git-Url: https://git.rrq.au/?a=commitdiff_plain;h=73b5fa677280bf223b38378d8db5fc374be75b5f;p=rrq%2Frrqnet.git fix the heartbeat bug --- 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;