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
Made --existing the main option, with --ignore-non-existing
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
1bc25bc
..
8f26f03
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-68,6
+68,7
@@
extern struct filter_list_struct filter_list;
extern struct filter_list_struct server_filter_list;
int io_error;
extern struct filter_list_struct server_filter_list;
int io_error;
+int checksum_len;
dev_t filesystem_dev; /* used to implement -x */
static char empty_sum[MD4_SUM_LENGTH];
dev_t filesystem_dev; /* used to implement -x */
static char empty_sum[MD4_SUM_LENGTH];
@@
-84,6
+85,7
@@
void init_flist(void)
/* Figure out how big the file_struct is without trailing padding */
file_struct_len = offsetof(struct file_struct, flags) + sizeof f.flags;
/* Figure out how big the file_struct is without trailing padding */
file_struct_len = offsetof(struct file_struct, flags) + sizeof f.flags;
+ checksum_len = protocol_version < 21 ? 2 : MD4_SUM_LENGTH;
}
static int show_filelist_p(void)
}
static int show_filelist_p(void)
@@
-475,14
+477,13
@@
void send_file_entry(struct file_struct *file, int f, unsigned short base_flags)
if (always_checksum && (S_ISREG(mode) || protocol_version < 28)) {
char *sum;
if (always_checksum && (S_ISREG(mode) || protocol_version < 28)) {
char *sum;
- int slen = protocol_version < 21 ? 2 : MD4_SUM_LENGTH;
if (S_ISREG(mode))
sum = file->u.sum;
else {
/* Prior to 28, we sent a useless set of nulls. */
sum = empty_sum;
}
if (S_ISREG(mode))
sum = file->u.sum;
else {
/* Prior to 28, we sent a useless set of nulls. */
sum = empty_sum;
}
- write_buf(f, sum,
s
len);
+ write_buf(f, sum,
checksum_
len);
}
strlcpy(lastname, fname, MAXPATHLEN);
}
strlcpy(lastname, fname, MAXPATHLEN);
@@
-698,7
+699,6
@@
static struct file_struct *receive_file_entry(struct file_list *flist,
if (always_checksum && (sum_len || protocol_version < 28)) {
char *sum;
if (always_checksum && (sum_len || protocol_version < 28)) {
char *sum;
- int slen = protocol_version < 21 ? 2 : MD4_SUM_LENGTH;
if (sum_len) {
file->u.sum = sum = bp;
/*bp += sum_len;*/
if (sum_len) {
file->u.sum = sum = bp;
/*bp += sum_len;*/
@@
-706,7
+706,7
@@
static struct file_struct *receive_file_entry(struct file_list *flist,
/* Prior to 28, we get a useless set of nulls. */
sum = empty_sum;
}
/* Prior to 28, we get a useless set of nulls. */
sum = empty_sum;
}
- read_buf(f, sum,
s
len);
+ read_buf(f, sum,
checksum_
len);
}
if (!preserve_perms) {
}
if (!preserve_perms) {
@@
-820,7
+820,7
@@
struct file_struct *make_file(char *fname, struct file_list *flist,
return NULL;
}
return NULL;
}
-skip_filters:
+
skip_filters:
if (verbose > 2) {
rprintf(FINFO, "[%s] make_file(%s,*,%d)\n",
if (verbose > 2) {
rprintf(FINFO, "[%s] make_file(%s,*,%d)\n",
@@
-848,7
+848,8
@@
skip_filters:
linkname_len = 0;
#endif
linkname_len = 0;
#endif
- sum_len = always_checksum && S_ISREG(st.st_mode) ? MD4_SUM_LENGTH : 0;
+ sum_len = always_checksum && am_sender && S_ISREG(st.st_mode)
+ ? MD4_SUM_LENGTH : 0;
alloc_len = file_struct_len + dirname_len + basename_len
+ linkname_len + sum_len;
alloc_len = file_struct_len + dirname_len + basename_len
+ linkname_len + sum_len;
@@
-1313,7
+1314,6
@@
struct file_list *recv_file_list(int f)
if (!flist->files)
goto oom;
if (!flist->files)
goto oom;
-
while ((flags = read_byte(f)) != 0) {
struct file_struct *file;
while ((flags = read_byte(f)) != 0) {
struct file_struct *file;
@@
-1374,7
+1374,7
@@
struct file_list *recv_file_list(int f)
return flist;
return flist;
-oom:
+
oom:
out_of_memory("recv_file_list");
return NULL; /* not reached */
}
out_of_memory("recv_file_list");
return NULL; /* not reached */
}