From: Wayne Davison Date: Sat, 4 Apr 2009 14:24:38 +0000 (-0700) Subject: Fixed --dry-run with --read-batch: X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/83c32ca572364c0bbd28bff88664f1041f48a3f5 Fixed --dry-run with --read-batch: - Avoid sending MSG_NO_SEND to the generator. - Check if the file is wanted before discarding the batched data. --- diff --git a/receiver.c b/receiver.c index 4325e30f..ee8e015a 100644 --- a/receiver.c +++ b/receiver.c @@ -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) {