X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/64c3523a6f1f5d6c83571f5f7e921129af42d177..d17e1dd2dae6bfd9e2e147a0dd3039848dd43abc:/sender.c diff --git a/sender.c b/sender.c index 027dfea8..1d9a132b 100644 --- a/sender.c +++ b/sender.c @@ -34,8 +34,6 @@ extern int am_server; * and transmits them to the receiver. The sender process runs on the * machine holding the source files. **/ - - void read_sum_head(int f, struct sum_struct *sum) { extern int protocol_version; @@ -71,10 +69,10 @@ static struct sum_struct *receive_sums(int f) s->sums = NULL; - if (verbose > 3) - rprintf(FINFO, "count=%ld n=%ld rem=%ld\n", - (long) s->count, (long) s->blength, - (long) s->remainder); + if (verbose > 3) { + rprintf(FINFO, "count=%ld n=%u rem=%u\n", + (long)s->count, s->blength, s->remainder); + } if (s->count == 0) return(s); @@ -155,6 +153,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) file = flist->files[i]; + stats.current_file_index = i; stats.num_transferred_files++; stats.total_transferred_size += file->length; @@ -170,7 +169,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) strlcat(fname, "/", MAXPATHLEN); offset = strlen(file->basedir)+1; } - strlcat(fname, f_name(file), MAXPATHLEN); + f_name_to(file, fname + offset, MAXPATHLEN - offset); if (verbose > 2) rprintf(FINFO, "send_files(%d, %s)\n", i, fname); @@ -193,7 +192,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) } if (write_batch) - write_batch_csum_info(&i, flist->count, s); + write_batch_csum_info(&i, s); if (!read_batch) { fd = do_open(fname, O_RDONLY, 0); @@ -251,7 +250,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) /* read checksums originally computed on sender side */ read_batch_csum_info(i, s, &checksums_match); if (checksums_match) { - read_batch_delta_file( (char *) &j, sizeof(int) ); + read_batch_delta_file((char*)&j, sizeof (int)); if (j != i) { /* if flist index entries don't match*/ rprintf(FINFO, "index mismatch in send_files\n"); rprintf(FINFO, "read index = %d flist ndx = %d\n", j, i); @@ -263,7 +262,7 @@ void send_files(struct file_list *flist, int f_out, int f_in) write_sum_head(f_out, s); done = 0; while (!done) { - read_batch_delta_file( (char *) &buff_len, sizeof(int) ); + read_batch_delta_file((char*)&buff_len, sizeof (int)); write_int(f_out, buff_len); if (buff_len == 0) { done = 1;