---- orig/main.c 2004-09-29 17:58:26
-+++ main.c 2004-07-15 02:40:51
-@@ -56,6 +56,9 @@ extern int write_batch;
- extern int batch_fd;
- extern int batch_gen_fd;
- 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;
-@@ -771,18 +774,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 && !read_batch) {
-+#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
-- && !read_batch) {
-+ if (url_prefix) {
- char *host, *path;
-
-- host = argv[0] + strlen(URL_PREFIX);
-+ host = argv[0] + url_prefix;
- p = strchr(host,'/');
- if (p) {
- *p = '\0';
-@@ -835,12 +852,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';
---- orig/options.c 2004-09-23 17:42:07
-+++ options.c 2004-07-16 20:19:50
-@@ -135,6 +135,14 @@ int quiet = 0;