summaryrefslogtreecommitdiff
path: root/receiver.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-03-29 22:05:33 +0000
committerWayne Davison <wayned@samba.org>2005-03-29 22:05:33 +0000
commit1ed91a04fe62c11d339866fc8e4afde88af80fbe (patch)
tree0cf3187f4e35a45ef2cd4585a5d25791cf0ada7e /receiver.c
parent154cdaaa4017cc3b878a3ef4960167ccf8d9fd61 (diff)
downloadrsync-1ed91a04fe62c11d339866fc8e4afde88af80fbe.tar.gz
- Fixed a potential crash if the receiver couldn't open the basis file
and the sender (possibly via a batch) tells us to use basis data. - Enhanced the batched-update skipping message to indicate what phase is being skipped.
Diffstat (limited to 'receiver.c')
-rw-r--r--receiver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/receiver.c b/receiver.c
index f674367e..53537c38 100644
--- a/receiver.c
+++ b/receiver.c
@@ -62,6 +62,7 @@ extern struct filter_list_struct server_filter_list;
static uint32 **delayed_bits = NULL;
static int delayed_slot_cnt = 0;
+static int phase = 0;
static void init_delayed_bits(int max_ndx)
{
@@ -266,7 +267,7 @@ static int receive_data(int f_in, char *fname_r, int fd_r, OFF_T size_r,
continue;
}
}
- if (fd != -1 && write_file(fd, map, len) != (int)len)
+ if (fd != -1 && map && write_file(fd, map, len) != (int)len)
goto report_write_error;
offset += len;
}
@@ -348,7 +349,8 @@ static int get_next_gen_i(int batch_gen_fd, int next_gen_i, int desired_i)
while (next_gen_i < desired_i) {
if (next_gen_i >= 0) {
rprintf(FINFO,
- "(No batched update for \"%s\")\n",
+ "(No batched update for%s \"%s\")\n",
+ phase ? " resend of" : "",
safe_fname(f_name(the_file_list->files[next_gen_i])));
}
next_gen_i = read_int(batch_gen_fd);
@@ -380,7 +382,7 @@ 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 phase = 0, max_phase = protocol_version >= 29 ? 2 : 1;
+ int max_phase = protocol_version >= 29 ? 2 : 1;
int i, recv_ok;
if (verbose > 2)