Clarify the read-batch fix.
[rsync/rsync.git] / generator.c
index 0724f18..6c7bf89 100644 (file)
@@ -700,7 +700,7 @@ void itemize(const char *fnamecmp, struct file_struct *file, int ndx, int statre
                        if (iflags & ITEM_XNAME_FOLLOWS)
                                write_vstring(sock_f_out, xname, strlen(xname));
 #ifdef SUPPORT_XATTRS
-                       if (preserve_xattrs && !dry_run
+                       if (preserve_xattrs && do_xfers
                         && iflags & (ITEM_REPORT_XATTR|ITEM_TRANSFER)) {
                                send_xattr_request(NULL, file,
                                        iflags & ITEM_REPORT_XATTR ? sock_f_out : -1);
@@ -2137,10 +2137,9 @@ void check_for_finished_files(int itemizing, enum logcode code, int check_redo)
                if (first_flist->in_progress || first_flist->to_redo)
                        break;
 
-               if (!read_batch) {
-                       write_ndx(sock_f_out, NDX_DONE);
+               write_ndx(sock_f_out, NDX_DONE);
+               if (!read_batch)
                        maybe_flush_socket(1);
-               }
 
                if (delete_during == 2 || !dir_tweaking) {
                        /* Skip directory touch-up. */
@@ -2285,9 +2284,6 @@ void generate_files(int f_out, const char *local_name)
                }
        } while ((cur_flist = cur_flist->next) != NULL);
 
-       if (read_batch && inc_recurse)
-               write_ndx(f_out, NDX_DONE);
-
        if (delete_during)
                delete_in_dir(NULL, NULL, &dev_zero);
        phase++;