port and double-colon

Shinichi Maruyama marya at st.jip.co.jp
Mon Dec 6 07:58:01 GMT 2004


  double-colon mode doesn't work in CVS version.
  -vv says port number is 0.

% rsync -vv host.domain::any
opening tcp connection to host.domain port 0
rsync: failed to connect to host.domain: Can't assign requested address (49)
rsync error: error in socket IO (code 10) at clientserver.c(94)

  And --port=873 cannot be used in client mode now.

  I made a small sample patch.
  (Sorry, I didn't make a patch to the manual.)

-- 
Yes, I'm in panic.
Shinichi Maruyama (marya at st.jip.co.jp)
-------------- next part --------------
Index: clientserver.c
===================================================================
RCS file: /cvsroot/rsync/clientserver.c,v
retrieving revision 1.132
diff -u -r1.132 clientserver.c
--- clientserver.c	27 Nov 2004 18:24:12 -0000	1.132
+++ clientserver.c	6 Dec 2004 07:38:29 -0000
@@ -88,6 +88,9 @@
 		*p = '\0';
 	}
 
+	if (rsync_port == 0 && (rsync_port = lp_rsync_port()) == 0)
+		rsync_port = RSYNC_PORT;
+
 	fd = open_socket_out_wrapped(host, rsync_port, bind_address,
 				     default_af_hint);
 	if (fd == -1)
Index: options.c
===================================================================
RCS file: /cvsroot/rsync/options.c,v
retrieving revision 1.190
diff -u -r1.190 options.c
--- options.c	27 Nov 2004 18:24:12 -0000	1.190
+++ options.c	6 Dec 2004 07:38:30 -0000
@@ -307,6 +307,7 @@
   rprintf(F,"     --bwlimit=KBPS          limit I/O bandwidth, KBytes per second\n");
   rprintf(F,"     --write-batch=FILE      write a batch to FILE\n");
   rprintf(F,"     --read-batch=FILE       read a batch from FILE\n");
+  rprintf(F,"     --port=PORT             specify double-colon alternate port number\n");
 #ifdef INET6
   rprintf(F," -4, --ipv4                  prefer IPv4\n");
   rprintf(F," -6, --ipv6                  prefer IPv6\n");
@@ -404,6 +405,7 @@
   {"no-implied-dirs",  0,  POPT_ARG_VAL,    &implied_dirs, 0, 0, 0 },
   {"protocol",         0,  POPT_ARG_INT,    &protocol_version, 0, 0, 0 },
   {"checksum-seed",    0,  POPT_ARG_INT,    &checksum_seed, 0, 0, 0 },
+  {"port",             0,  POPT_ARG_INT,    &rsync_port, 0, 0, 0 },
 #ifdef INET6
   {"ipv4",            '4', POPT_ARG_VAL,    &default_af_hint, AF_INET, 0, 0 },
   {"ipv6",            '6', POPT_ARG_VAL,    &default_af_hint, AF_INET6, 0, 0 },
@@ -413,7 +415,6 @@
   {"config",           0,  POPT_ARG_STRING, 0, OPT_DAEMON, 0, 0 },
   {"daemon",           0,  POPT_ARG_NONE,   0, OPT_DAEMON, 0, 0 },
   {"no-detach",        0,  POPT_ARG_NONE,   0, OPT_DAEMON, 0, 0 },
-  {"port",             0,  POPT_ARG_INT,    0, OPT_DAEMON, 0, 0 },
   {0,0,0,0, 0, 0, 0}
 };
 


More information about the rsync mailing list