---- main.c 28 Jun 2004 17:45:40 -0000 1.201
-+++ main.c 30 Jun 2004 00:11:17 -0000
-@@ -52,6 +52,9 @@ extern int rsync_port;
- extern int read_batch;
- extern int write_batch;
- extern int filesfrom_fd;
-+#ifdef HAVE_OPENSSL
-+extern int use_ssl;
-+#endif
- extern pid_t cleanup_child_pid;
- extern char *files_from;
- extern char *remote_filesfrom_file;
-@@ -719,17 +722,32 @@ static int start_client(int argc, char *
- pid_t pid;
- int f_in,f_out;
- int rc;
-+ int url_prefix = strlen(URL_PREFIX);
-
- /* Don't clobber argv[] so that ps(1) can still show the right
- * command line. */
- if ((rc = copy_argv(argv)))
- return rc;
-
-+ if (strncasecmp(URL_PREFIX, argv[0], url_prefix) != 0) {
-+#ifdef HAVE_OPENSSL
-+ url_prefix = strlen(SSL_URL_PREFIX);
-+ if (strncasecmp(SSL_URL_PREFIX, argv[0], url_prefix) != 0)
-+ url_prefix = 0;
-+ else {
-+ if (!use_ssl)
-+ init_tls();
-+ use_ssl = 1;
-+ }
-+#else
-+ url_prefix = 0;
-+#endif
-+ }
- /* rsync:// always uses rsync server over direct socket connection */
-- if (strncasecmp(URL_PREFIX, argv[0], strlen(URL_PREFIX)) == 0) {
-+ if (url_prefix) {
- char *host, *path;
-
-- host = argv[0] + strlen(URL_PREFIX);
-+ host = argv[0] + url_prefix;
- p = strchr(host,'/');
- if (p) {
- *p = 0;
-@@ -777,12 +795,27 @@ static int start_client(int argc, char *
- argv++;
- } else { /* source is local */
- am_sender = 1;
-+ url_prefix = strlen(URL_PREFIX);
-+ if (strncasecmp(URL_PREFIX, argv[0], url_prefix) != 0) {
-+#ifdef HAVE_OPENSSL
-+ url_prefix = strlen(SSL_URL_PREFIX);
-+ if (strncasecmp(SSL_URL_PREFIX, argv[0], url_prefix) != 0)
-+ url_prefix = 0;
-+ else {
-+ if (!use_ssl)
-+ init_tls();
-+ use_ssl = 1;
-+ }
-+#else
-+ url_prefix = 0;
-+#endif
-+ }
-
- /* rsync:// destination uses rsync server over direct socket */
-- if (strncasecmp(URL_PREFIX, argv[argc-1], strlen(URL_PREFIX)) == 0) {
-+ if (url_prefix) {
- char *host, *path;
-
-- host = argv[argc-1] + strlen(URL_PREFIX);
-+ host = argv[argc-1] + url_prefix;
- p = strchr(host,'/');
- if (p) {
- *p = 0;
---- options.c 20 Jun 2004 19:47:05 -0000 1.157
-+++ options.c 30 Jun 2004 00:11:18 -0000
-@@ -133,6 +133,14 @@ int quiet = 0;