Fixed --dry-run with --read-batch:
authorWayne Davison <wayned@samba.org>
Sat, 4 Apr 2009 14:24:38 +0000 (07:24 -0700)
committerWayne Davison <wayned@samba.org>
Sat, 4 Apr 2009 14:25:25 +0000 (07:25 -0700)
- Avoid sending MSG_NO_SEND to the generator.
- Check if the file is wanted before discarding the batched data.

receiver.c

index 4325e30..ee8e015 100644 (file)
@@ -361,7 +361,7 @@ static void no_batched_update(int ndx, BOOL is_redo)
        rprintf(FERROR_XFER, "(No batched update for%s \"%s\")\n",
                is_redo ? " resend of" : "", f_name(file, NULL));
 
-       if (inc_recurse)
+       if (inc_recurse && !dry_run)
                send_msg_int(MSG_NO_SEND, ndx);
 }
 
@@ -562,19 +562,6 @@ int recv_files(int f_in, char *local_name)
                        exit_cleanup(RERR_PROTOCOL);
                }
 
-               if (!do_xfers) { /* log the transfer */
-                       log_item(FCLIENT, file, &stats, iflags, NULL);
-                       if (read_batch)
-                               discard_receive_data(f_in, F_LENGTH(file));
-                       continue;
-               }
-               if (write_batch < 0) {
-                       log_item(FCLIENT, file, &stats, iflags, NULL);
-                       if (!am_server)
-                               discard_receive_data(f_in, F_LENGTH(file));
-                       continue;
-               }
-
                if (read_batch) {
                        int wanted = redoing
                                   ? we_want_redo(ndx)
@@ -590,6 +577,19 @@ int recv_files(int f_in, char *local_name)
                        }
                }
 
+               if (!do_xfers) { /* log the transfer */
+                       log_item(FCLIENT, file, &stats, iflags, NULL);
+                       if (read_batch)
+                               discard_receive_data(f_in, F_LENGTH(file));
+                       continue;
+               }
+               if (write_batch < 0) {
+                       log_item(FCLIENT, file, &stats, iflags, NULL);
+                       if (!am_server)
+                               discard_receive_data(f_in, F_LENGTH(file));
+                       continue;
+               }
+
                partialptr = partial_dir ? partial_dir_fname(fname) : fname;
 
                if (protocol_version >= 29) {