synk

synchronize files between hosts
Log | Files | Refs | README | LICENSE

commit aa9ebd6d6195dad020c1e2ff124a955b62e120b2
parent a1da0e4995ec90f1913f3680543dc0f3c86c524c
Author: z3bra <willyatmailoodotorg>
Date:   Fri Sep  9 13:28:55 +0200

Wait for the client to close the connection

Diffstat:
synk.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/synk.c b/synk.c @@ -302,6 +302,7 @@ flushpeers(struct peers_t *plist) int sendmetadata(struct client_t *c) { + char buf; ssize_t len = 0; struct metadata_t *local, remote; @@ -316,8 +317,9 @@ sendmetadata(struct client_t *c) /* .. and send it to the client */ write(c->fd, local, sizeof(struct metadata_t)); - close(c->fd); + while (recv(c->fd, &buf, 1, MSG_PEEK) > 0); + close(c->fd); free(c); return -1;