From a125c82ad2b54100bcca9bb8671fb374c81f7643 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 1 Aug 2002 17:53:38 +0000 Subject: [PATCH] Allow the rsync:// URL syntax in the destination field. --- main.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index cf2674d6..de6a62b2 100644 --- a/main.c +++ b/main.c @@ -687,7 +687,7 @@ static int start_client(int argc, char *argv[]) *p = 0; path = p+1; } else { - path=""; + path = ""; } p = strchr(host,':'); if (p) { @@ -698,7 +698,7 @@ static int start_client(int argc, char *argv[]) } if (!read_batch) { - p = find_colon(argv[0]); + p = find_colon(argv[0]); if (p) { if (p[1] == ':') { /* double colon */ @@ -725,6 +725,26 @@ static int start_client(int argc, char *argv[]) } else { am_sender = 1; + /* rsync:// destination uses rsync server over direct socket */ + if (strncasecmp(URL_PREFIX, argv[argc-1], strlen(URL_PREFIX)) == 0) { + char *host, *path; + + host = argv[argc-1] + strlen(URL_PREFIX); + p = strchr(host,'/'); + if (p) { + *p = 0; + path = p+1; + } else { + path = ""; + } + p = strchr(host,':'); + if (p) { + rsync_port = atoi(p+1); + *p = 0; + } + return start_socket_client(host, path, argc-1, argv); + } + p = find_colon(argv[argc-1]); if (!p) { local_server = 1; -- 2.34.1