Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use new stringjoin() function.
[rsync/rsync.git]
/
sender.c
diff --git
a/sender.c
b/sender.c
index
9dbee0e
..
8b649a8
100644
(file)
--- a/
sender.c
+++ b/
sender.c
@@
-25,6
+25,8
@@
extern struct stats stats;
extern int io_error;
extern int dry_run;
extern int am_server;
extern int io_error;
extern int dry_run;
extern int am_server;
+extern int am_daemon;
+extern int protocol_version;
/**
/**
@@
-34,12
+36,8
@@
extern int am_server;
* and transmits them to the receiver. The sender process runs on the
* machine holding the source files.
**/
* 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)
{
void read_sum_head(int f, struct sum_struct *sum)
{
- extern int protocol_version;
-
sum->count = read_int(f);
sum->blength = read_int(f);
if (protocol_version < 27) {
sum->count = read_int(f);
sum->blength = read_int(f);
if (protocol_version < 27) {
@@
-71,10
+69,10
@@
static struct sum_struct *receive_sums(int f)
s->sums = NULL;
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);
if (s->count == 0)
return(s);
@@
-155,20
+153,20
@@
void send_files(struct file_list *flist, int f_out, int f_in)
file = flist->files[i];
file = flist->files[i];
+ stats.current_file_index = i;
stats.num_transferred_files++;
stats.total_transferred_size += file->length;
fname[0] = 0;
if (file->basedir) {
stats.num_transferred_files++;
stats.total_transferred_size += file->length;
fname[0] = 0;
if (file->basedir) {
- strlcpy(fname, file->basedir, MAXPATHLEN);
- if (strlen(fname) == MAXPATHLEN-1) {
+ offset = stringjoin(fname, sizeof fname,
+ file->basedir, "/", NULL);
+ if (offset >= MAXPATHLEN-1) {
io_error |= IOERR_GENERAL;
rprintf(FERROR, "send_files failed on long-named directory %s\n",
full_fname(fname));
return;
}
io_error |= IOERR_GENERAL;
rprintf(FERROR, "send_files failed on long-named directory %s\n",
full_fname(fname));
return;
}
- strlcat(fname, "/", MAXPATHLEN);
- offset = strlen(file->basedir)+1;
}
f_name_to(file, fname + offset, MAXPATHLEN - offset);
}
f_name_to(file, fname + offset, MAXPATHLEN - offset);
@@
-193,14
+191,17
@@
void send_files(struct file_list *flist, int f_out, int f_in)
}
if (write_batch)
}
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);
if (fd == -1) {
if (errno == ENOENT) {
if (!read_batch) {
fd = do_open(fname, O_RDONLY, 0);
if (fd == -1) {
if (errno == ENOENT) {
+ enum logcode c = am_daemon
+ && protocol_version < 28 ? FERROR
+ : FINFO;
io_error |= IOERR_VANISHED;
io_error |= IOERR_VANISHED;
- rprintf(
FINFO
, "file has vanished: %s\n",
+ rprintf(
c
, "file has vanished: %s\n",
full_fname(fname));
} else {
io_error |= IOERR_GENERAL;
full_fname(fname));
} else {
io_error |= IOERR_GENERAL;