Batch files need to be written with the new subprotocol value
authorWayne Davison <wayned@samba.org>
Sat, 21 Apr 2007 19:32:46 +0000 (19:32 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 21 Apr 2007 19:32:46 +0000 (19:32 +0000)
for protocol 30.

compat.c
io.c
rsync.h

index 4b57ec4..0cfb78f 100644 (file)
--- a/compat.c
+++ b/compat.c
@@ -77,7 +77,7 @@ void setup_protocol(int f_out,int f_in)
                        protocol_version = remote_protocol;
                /* CVS support: fallback to finalized protocol if incompatible */
                if (protocol_version >= 30) {
-                       int theirsub, oursub = PROTOCOL_SUBVERSION;
+                       int theirsub, oursub = SUBPROTOCOL_VERSION;
                        if (!read_batch)
                                write_varint(f_out, oursub);
                        theirsub = read_varint(f_in);
diff --git a/io.c b/io.c
index a7603ff..571f1ff 100644 (file)
--- a/io.c
+++ b/io.c
@@ -1715,6 +1715,11 @@ void start_write_batch(int fd)
         * actual communication so far depends on whether a daemon
         * is involved. */
        write_int(batch_fd, protocol_version);
+       if (protocol_version >= 30) {
+               int sub = protocol_version == PROTOCOL_VERSION
+                       ? SUBPROTOCOL_VERSION : 0;
+               write_varint(batch_fd, sub);
+       }
        write_int(batch_fd, checksum_seed);
 
        if (am_sender)
diff --git a/rsync.h b/rsync.h
index eccbce0..5bb155e 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -86,7 +86,7 @@
 /* This is used when working on a new protocol version in CVS, and should
  * be a new non-zero value for each CVS change that affects the protocol.
  * It must ALWAYS be 0 when the protocol goes final! */
-#define PROTOCOL_SUBVERSION 1
+#define SUBPROTOCOL_VERSION 1
 
 /* We refuse to interoperate with versions that are not in this range.
  * Note that we assume we'll work with later versions: the onus is on