Backed out the hack that reversed ITEM_REPORT_XATTRS with
authorWayne Davison <wayned@samba.org>
Sun, 6 Mar 2005 23:37:42 +0000 (23:37 +0000)
committerWayne Davison <wayned@samba.org>
Sun, 6 Mar 2005 23:37:42 +0000 (23:37 +0000)
ITEM_TRANSFER.  Yes, it allowed some kludge code that made backward
compatibility seamless, but it made it impossible to remove the hack
in the future.  This way, the backward compatibility is just
slightly inaccurate in the display of the first letter in the %i
output, and the only hack can be safely removed without causing
problems.

generator.c
rsync.h
sender.c

index c547529fc025e962baf4751406f79c65276716af..dde3f3485d707d2846dd404ce6ab9bfd5773e6a2 100644 (file)
@@ -341,9 +341,6 @@ void itemize(struct file_struct *file, int ndx, int statret, STRUCT_STAT *st,
                if (protocol_version >= 29) {
                        if (ndx >= 0)
                                write_int(sock_f_out, ndx);
-                       /* XXX Temorary compatibility hack */
-                       if (iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE))
-                               iflags |= ITEM_REPORT_XATTRS; /* ITEM_UPDATE */
                        write_shortint(sock_f_out, iflags);
                        if (hlink)
                                write_vstring(sock_f_out, hlink, strlen(hlink));
diff --git a/rsync.h b/rsync.h
index edeabc6fe7af9008f942a4074da2d4ee91e0fd9f..b493fefb45c56408559b765e63bd3c6e66b29073 100644 (file)
--- a/rsync.h
+++ b/rsync.h
 #define DEL_TERSE              (1<<3)
 
 /* For use by the itemize_changes code */
-#define ITEM_REPORT_XATTRS (1<<0)
+#define ITEM_TRANSFER (1<<0)
 #define ITEM_REPORT_CHECKSUM (1<<1)
 #define ITEM_REPORT_SIZE (1<<2)
 #define ITEM_REPORT_TIME (1<<3)
 #define ITEM_USING_ALT_BASIS (1<<8)
 #define ITEM_HARD_LINKED (1<<9)
 #define ITEM_LOCAL_CHANGE (1<<10)
-#define ITEM_TRANSFER (1<<11)
+#define ITEM_REPORT_XATTRS (1<<11)
 /* These are outside the range of the transmitted flags. */
 #define ITEM_NO_DEST_AND_NO_UPDATE (1<<16) /* used by itemize() */
 #define ITEM_MISSING_DATA (1<<16)         /* used by log_formatted() */
 
 #define SIGNIFICANT_ITEM_FLAGS (ITEM_TRANSFER | ITEM_REPORT_CHECKSUM \
        | ITEM_REPORT_SIZE | ITEM_REPORT_TIME | ITEM_REPORT_PERMS \
-       | ITEM_REPORT_OWNER | ITEM_REPORT_GROUP | ITEM_IS_NEW)
+       | ITEM_REPORT_OWNER | ITEM_REPORT_GROUP | ITEM_REPORT_XATTRS \
+       | ITEM_IS_NEW)
 
 
 /* Log-message categories.  FLOG and FCLIENT are only used on the daemon
index 399882251fa75400d02f4f241cfc323dcca45009..a9e426b62e26f431724d33d6c2a6189b793b170e 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -153,15 +153,11 @@ int read_iflags(int f_in, int f_out, int ndx, char *buf)
                len = -1;
        }
 
-       /* XXX Temporary compatibility hack */
-       if (iflags & ITEM_REPORT_XATTRS) { /* old ITEM_UPDATE */
-               iflags &= ~ITEM_REPORT_XATTRS;
-               if (!(iflags & (ITEM_TRANSFER|ITEM_LOCAL_CHANGE))) {
-                       if (S_ISREG(the_file_list->files[ndx]->mode))
-                               iflags |= ITEM_TRANSFER;
-                       else
-                               iflags |= ITEM_LOCAL_CHANGE;
-               }
+       /* XXX Temporary backward compatibility when talking to 2.6.4pre[12] */
+       if (protocol_version >= 29 && iflags & ITEM_TRANSFER
+           && !S_ISREG(the_file_list->files[ndx]->mode)) {
+               iflags &= ~ITEM_TRANSFER;
+               iflags |= ITEM_LOCAL_CHANGE;
        }
 
        if (iflags & ITEM_TRANSFER) {
@@ -256,7 +252,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
                                log_item(file, &stats, iflags, NULL);
                        write_int(f_out, i);
                        if (protocol_version >= 29)
-                               write_shortint(f_out, iflags | ITEM_REPORT_XATTRS);
+                               write_shortint(f_out, iflags);
                        continue;
                }
 
@@ -309,7 +305,7 @@ void send_files(struct file_list *flist, int f_out, int f_in)
 
                write_int(f_out, i);
                if (protocol_version >= 29)
-                       write_shortint(f_out, iflags | ITEM_REPORT_XATTRS);
+                       write_shortint(f_out, iflags);
                write_sum_head(f_out, s);
 
                if (verbose > 2) {