+ if (am_sender) {
+ char *dummy_host;
+ int dummy_port = rsync_port;
+ int i;
+ /* For local source, extra source args must not have hostspec. */
+ for (i = 1; i < argc; i++) {
+ if (check_for_hostspec(argv[i], &dummy_host, &dummy_port)) {
+ rprintf(FERROR, "Unexpected remote arg: %s\n", argv[i]);
+ exit_cleanup(RERR_SYNTAX);
+ }
+ }
+ } else {
+ char *dummy_host;
+ int dummy_port = rsync_port;
+ int i;
+ /* For remote source, any extra source args must have either
+ * the same hostname or an empty hostname. */
+ for (i = 1; i < remote_argc; i++) {
+ char *arg = check_for_hostspec(remote_argv[i], &dummy_host, &dummy_port);
+ if (!arg) {
+ rprintf(FERROR, "Unexpected local arg: %s\n", remote_argv[i]);
+ rprintf(FERROR, "If arg is a remote file/dir, prefix it with a colon (:).\n");
+ exit_cleanup(RERR_SYNTAX);
+ }
+ if (*dummy_host && strcmp(dummy_host, shell_machine) != 0) {
+ rprintf(FERROR, "All source args must come from the same machine.\n");
+ exit_cleanup(RERR_SYNTAX);
+ }
+ if (rsync_port != dummy_port) {
+ if (!rsync_port || !dummy_port)
+ rprintf(FERROR, "All source args must use the same hostspec format.\n");
+ else
+ rprintf(FERROR, "All source args must use the same port number.\n");
+ exit_cleanup(RERR_SYNTAX);
+ }
+ remote_argv[i] = arg;
+ }
+ if (argc == 0) {
+ list_only |= 1;
+ xfer_dirs |= 1;
+ }
+ }
+
+ if (daemon_over_rsh < 0)
+ return start_socket_client(shell_machine, remote_argc, remote_argv, argc, argv);
+