summaryrefslogtreecommitdiff
path: root/src/ot_livesync.c
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2026-11-05 13:52:17 +0100
committerDirk Engling <erdgeist@erdgeist.org>2026-11-05 13:52:17 +0100
commit47293a4f116e04a88b0797bafad0c98b4393b744 (patch)
treeb71d19aa8637382a6d3b453614a6a52a2c1b3245 /src/ot_livesync.c
parent9a3a01643fc78bf544a1e6f5ca5c7529e2026b25 (diff)
Clamp every elapsed time span at zero, using a set of helper functions
Diffstat (limited to 'src/ot_livesync.c')
-rw-r--r--src/ot_livesync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ot_livesync.c b/src/ot_livesync.c
index 85577f7..7d7208e 100644
--- a/src/ot_livesync.c
+++ b/src/ot_livesync.c
@@ -178,13 +178,13 @@ void livesync_ticker(void) {
178 178
179 /* livesync_issue_peersync sets g_next_packet_time */ 179 /* livesync_issue_peersync sets g_next_packet_time */
180 pthread_mutex_lock(&g_outbuf_mutex); 180 pthread_mutex_lock(&g_outbuf_mutex);
181 if (time_now_seconds() > g_v6_buf.next_packet_time && g_v6_buf.fill > sizeof(g_tracker_id) + sizeof(uint32_t)) 181 if (time_is_past(g_v6_buf.next_packet_time) && g_v6_buf.fill > sizeof(g_tracker_id) + sizeof(uint32_t))
182 livesync_issue_peersync(&g_v6_buf); 182 livesync_issue_peersync(&g_v6_buf);
183 else 183 else
184 pthread_mutex_unlock(&g_outbuf_mutex); 184 pthread_mutex_unlock(&g_outbuf_mutex);
185 185
186 pthread_mutex_lock(&g_outbuf_mutex); 186 pthread_mutex_lock(&g_outbuf_mutex);
187 if (time_now_seconds() > g_v4_buf.next_packet_time && g_v4_buf.fill > sizeof(g_tracker_id) + sizeof(uint32_t)) 187 if (time_is_past(g_v4_buf.next_packet_time) && g_v4_buf.fill > sizeof(g_tracker_id) + sizeof(uint32_t))
188 livesync_issue_peersync(&g_v4_buf); 188 livesync_issue_peersync(&g_v4_buf);
189 else 189 else
190 pthread_mutex_unlock(&g_outbuf_mutex); 190 pthread_mutex_unlock(&g_outbuf_mutex);