Add the sync command

Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
Adrien Gallouët
2018-05-21 09:26:37 +00:00
parent a3bb488fd5
commit 2dbf5fb765
8 changed files with 81 additions and 0 deletions

View File

@@ -289,6 +289,10 @@ gt_bind(int argc, char **argv)
res.status.bind = bind_addr;
res.status.peer = peer_addr;
break;
case CTL_SYNC:
if (mud_send(mud, NULL, 0, 0) == -1)
res.ret = errno;
break;
}
if (sendto(ctl_fd, &res, sizeof(res), 0,
(const struct sockaddr *)&ss, sl) == -1)