Add mud_sync()

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-06-15 10:05:42 +00:00
parent 03be90b606
commit 22e065e5cb
2 changed files with 5 additions and 2 deletions

5
mud.c
View File

@@ -502,9 +502,12 @@ mud_cmp_addr(struct sockaddr_storage *a, struct sockaddr_storage *b)
}
unsigned long
mud_get_sync_elapsed_msec(struct mud *mud)
mud_sync(struct mud *mud)
{
const uint64_t last = mud->last_recv_time;
mud_send(mud, NULL, 0, 0);
return last ? MUD_TIME_MASK(mud_now() - last) / MUD_ONE_MSEC : ~0UL;
}