Added a hack that uses the ITEM_REPORT_XATTRS bit (which is the old
authorWayne Davison <wayned@samba.org>
Sat, 5 Mar 2005 04:34:06 +0000 (04:34 +0000)
committerWayne Davison <wayned@samba.org>
Sat, 5 Mar 2005 04:34:06 +0000 (04:34 +0000)
ITEM_UPDATING bit) to make us compatible when sending/receiving bits
to/from an earlier pre-release.

sender.c

index 225383b..4d8fe2c 100644 (file)
--- a/sender.c
+++ b/sender.c
@@ -153,11 +153,15 @@ int read_iflags(int f_in, int f_out, int ndx, char *buf)
                len = -1;
        }
 
-       /* 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;
+       /* 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;
+               }
        }
 
        if (iflags & ITEM_TRANSFER) {
@@ -252,7 +256,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);
+                               write_shortint(f_out, iflags | ITEM_REPORT_XATTRS);
                        continue;
                }
 
@@ -305,7 +309,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);
+                       write_shortint(f_out, iflags | ITEM_REPORT_XATTRS);
                write_sum_head(f_out, s);
 
                if (verbose > 2) {