X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/08a740ff436a4c0dc1aa53d671f6f14b8bf2348a..8642efd0d6bb172c5fed17d545afa615148cfe6b:/clientserver.c diff --git a/clientserver.c b/clientserver.c index dd383d0b..70c12e20 100644 --- a/clientserver.c +++ b/clientserver.c @@ -44,7 +44,8 @@ int start_socket_client(char *host, char *path, int argc, char *argv[]) extern int am_sender; extern struct in_addr socket_address; extern char *shell_cmd; - + extern int kludge_around_eof; + if (argc == 0 && !am_sender) { extern int list_only; list_only = 1; @@ -106,6 +107,10 @@ int start_socket_client(char *host, char *path, int argc, char *argv[]) io_printf(fd,"%s\n",path); if (p) *p = '/'; + /* Old servers may just drop the connection here, + rather than sending a proper EXIT command. Yuck. */ + kludge_around_eof = remote_version < 25; + while (1) { if (!read_line(fd, line, sizeof(line)-1)) { return -1; @@ -122,6 +127,7 @@ int start_socket_client(char *host, char *path, int argc, char *argv[]) rprintf(FINFO,"%s\n", line); } + kludge_around_eof = False; for (i=0;i= 25) + io_printf(fd,"@RSYNCD: EXIT\n"); } /* this is called when a socket connection is established to a client