Use 0-length MSG_DATA when MSG_NOOP is not available
authorWayne Davison <wayned@samba.org>
Wed, 16 Dec 2009 21:32:03 +0000 (13:32 -0800)
committerWayne Davison <wayned@samba.org>
Wed, 16 Dec 2009 21:32:03 +0000 (13:32 -0800)
(is both safer and supports older rsyncs).

NEWS
io.c

diff --git a/NEWS b/NEWS
index 186f872f29785e06387fa50821069543f487c5da..a6cc1a4ee8fd5bba57a12a578332d6255b519eb2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Changes since 3.0.6:
     - Avoid an error when --dry-run  was trying to stat a prior hard-link file
       that hasn't really been created.
 
-    - Improved --skip-compress's error handling of bad character sets and got
+    - Improved --skip-compress's error handling of bad character-sets and got
       rid of a lingering debug fprintf().
 
     - Fixed the daemon's conveyance of io_error value from the sender.
@@ -21,6 +21,9 @@ Changes since 3.0.6:
 
     - Improved the "--delete does not work without -r or -d" message.
 
+    - Tweaked the sending of NOOP messages (which try to prevent a timeout) to
+      work with older protocols (supporting rsync 2.6.3 and older).
+
     - Some misc manpage improvements.
 
     - Fixed the chmod-temp-dir testsuite on a system without /var/tmp.
@@ -38,8 +41,13 @@ Changes since 3.0.6:
     - Made our (only used if missing) getaddrinfo() routine use inet_pton()
       (which we also provide) instead of inet_aton().
 
+    - The exit-related debug messages now mention the program's role so it is
+      clear who output what message.
+
   DEVELOPER RELATED:
 
     - Got rid of type-punned compiler warnings output by newer gcc versions.
 
     - The Makefile now ensures that proto.h will be rebuilt if config.h changes.
+
+    - The testsuite no longer uses "id -u", so it works better on solaris.
diff --git a/io.c b/io.c
index 4a00992c2b4c2e2e34f13dc4e64c312150695cf1..7675d34938106f664674c5fdd39b75461e343a85 100644 (file)
--- a/io.c
+++ b/io.c
@@ -949,14 +949,10 @@ void maybe_send_keepalive(void)
 {
        if (time(NULL) - last_io_out >= allowed_lull) {
                if (!iobuf_out || !iobuf_out_cnt) {
-                       if (protocol_version < 29)
-                               return; /* there's nothing we can do */
                        if (protocol_version >= 30)
                                send_msg(MSG_NOOP, "", 0, 0);
-                       else {
-                               write_int(sock_f_out, cur_flist->used);
-                               write_shortint(sock_f_out, ITEM_IS_NEW);
-                       }
+                       else
+                               send_msg(MSG_DATA, "", 0, 0);
                }
                if (iobuf_out)
                        io_flush(NORMAL_FLUSH);