+ if (verbose >= 2) {
+ /* FIXME: If we're going to use a socket program for
+ * testing, then this message is wrong. We need to
+ * say something like "(except really using %s)" */
+ rprintf(FINFO, "opening tcp connection to %s port %d\n",
+ host, rsync_port);
+ }
+ fd = open_socket_out_wrapped(host, rsync_port, bind_address,
+ default_af_hint);
+ if (fd == -1) {
+ exit_cleanup(RERR_SOCKETIO);
+ }
+
+ ret = start_inband_exchange(user, path, fd, fd, argc);
+
+ return ret < 0? ret : client_run(fd, fd, -1, argc, argv);
+}
+
+int start_inband_exchange(char *user, char *path, int f_in, int f_out, int argc)
+{
+ int i;
+ char *sargs[MAX_ARGS];
+ int sargc = 0;
+ char line[MAXPATHLEN];
+ char *p;
+ extern int kludge_around_eof;
+ extern int am_sender;
+ extern int daemon_over_rsh;
+ extern int list_only;
+
+ if (argc == 0 && !am_sender)
+ list_only = 1;
+
+ if (*path == '/') {
+ rprintf(FERROR, "ERROR: The remote path must start with a module name\n");
+ return -1;
+ }
+