aboutsummaryrefslogtreecommitdiffstats
path: root/receiver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-03-15 19:19:41 +0000
committerWayne Davison <wayned@samba.org>2005-03-15 19:19:41 +0000
commitac3f7b81f87a8d5461964181b2dd2033492bda5a (patch)
tree6199bf3cdb939002673b8bc95e0473145f5005eb /receiver.c
parent62f9573fb3ad52b0359fdf705e55d42677b7f9ed (diff)
downloadandroid_external_rsync-ac3f7b81f87a8d5461964181b2dd2033492bda5a.tar.gz
android_external_rsync-ac3f7b81f87a8d5461964181b2dd2033492bda5a.tar.bz2
android_external_rsync-ac3f7b81f87a8d5461964181b2dd2033492bda5a.zip
Added an extra phase to the end of the transfer to handle
delayed updates that have hard links.
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/receiver.c b/receiver.c
index d7c6f598..ff02e20b 100644
--- a/receiver.c
+++ b/receiver.c
@@ -365,7 +365,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
int save_make_backups = make_backups;
int itemizing = am_daemon ? daemon_log_format_has_i
: !am_server && log_format_has_i;
- int i, recv_ok, phase = 0;
+ int phase = 0, max_phase = protocol_version >= 29 ? 2 : 1;
+ int i, recv_ok;
if (verbose > 2)
rprintf(FINFO,"recv_files(%d) starting\n",flist->count);
@@ -388,16 +389,13 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
while (read_int(batch_gen_fd) != -1) {}
next_gen_i = -1;
}
- if (phase)
+ if (++phase > max_phase)
break;
- phase = 1;
csum_length = SUM_LENGTH;
if (verbose > 2)
rprintf(FINFO, "recv_files phase=%d\n", phase);
- if (delay_updates) {
+ if (phase == 2 && delay_updates)
handle_delayed_updates(flist, local_name);
- delay_updates = 0;
- }
send_msg(MSG_DONE, "", 0);
if (keep_partial && !partial_dir)
make_backups = 0; /* prevents double backup */
@@ -419,6 +417,12 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
maybe_log_item(file, iflags, itemizing, xname);
continue;
}
+ if (phase == 2) {
+ rprintf(FERROR,
+ "got transfer request in phase 2 [%s]\n",
+ who_am_i());
+ exit_cleanup(RERR_PROTOCOL);
+ }
stats.current_file_index = i;
stats.num_transferred_files++;
@@ -680,6 +684,8 @@ int recv_files(int f_in, struct file_list *flist, char *local_name)
}
make_backups = save_make_backups;
+ if (phase == 2 && delay_updates) /* for protocol_version < 29 */
+ handle_delayed_updates(flist, local_name);
if (verbose > 2)
rprintf(FINFO,"recv_files finished\n");