From c2b11ba0179b792d7c6fab765713a010c77f4322 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sun, 6 Mar 2005 23:37:42 +0000 Subject: [PATCH] Backed out the hack that reversed ITEM_REPORT_XATTRS with 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 | 3 --- rsync.h | 7 ++++--- sender.c | 18 +++++++----------- 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/generator.c b/generator.c index c547529f..dde3f348 100644 --- a/generator.c +++ b/generator.c @@ -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 edeabc6f..b493fefb 100644 --- a/rsync.h +++ b/rsync.h @@ -139,7 +139,7 @@ #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) @@ -150,7 +150,7 @@ #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() */ @@ -158,7 +158,8 @@ #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 diff --git a/sender.c b/sender.c index 39988225..a9e426b6 100644 --- 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) { -- 2.34.1