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
fixed a bug that made us use only 16 bits of the file checksum when
[rsync/rsync.git]
/
flist.c
diff --git
a/flist.c
b/flist.c
index
f7ab5a9
..
b8b4c66
100644
(file)
--- a/
flist.c
+++ b/
flist.c
@@
-23,8
+23,6
@@
extern struct stats stats;
extern struct stats stats;
-extern int csum_length;
-
extern int verbose;
extern int am_server;
extern int always_checksum;
extern int verbose;
extern int am_server;
extern int always_checksum;
@@
-254,7
+252,11
@@
static void send_file_entry(struct file_struct *file,int f,unsigned base_flags)
#endif
if (always_checksum) {
#endif
if (always_checksum) {
- write_buf(f,file->sum,csum_length);
+ if (remote_version < 21) {
+ write_buf(f,file->sum,2);
+ } else {
+ write_buf(f,file->sum,MD4_SUM_LENGTH);
+ }
}
last_mode = file->mode;
}
last_mode = file->mode;
@@
-353,7
+355,11
@@
static void receive_file_entry(struct file_struct **fptr,
if (always_checksum) {
file->sum = (char *)malloc(MD4_SUM_LENGTH);
if (!file->sum) out_of_memory("md4 sum");
if (always_checksum) {
file->sum = (char *)malloc(MD4_SUM_LENGTH);
if (!file->sum) out_of_memory("md4 sum");
- read_buf(f,file->sum,csum_length);
+ if (remote_version < 21) {
+ read_buf(f,file->sum,2);
+ } else {
+ read_buf(f,file->sum,MD4_SUM_LENGTH);
+ }
}
last_mode = file->mode;
}
last_mode = file->mode;
@@
-683,10
+689,17
@@
struct file_list *send_file_list(int f,int argc,char *argv[])
*p = '/';
for (p=fname+1; (p=strchr(p,'/')); p++) {
int copy_links_saved = copy_links;
*p = '/';
for (p=fname+1; (p=strchr(p,'/')); p++) {
int copy_links_saved = copy_links;
+ int recurse_saved = recurse;
*p = 0;
copy_links = copy_unsafe_links;
*p = 0;
copy_links = copy_unsafe_links;
+ /* set recurse to 1 to prevent make_file
+ from ignoring directory, but still
+ turn off the recursive parameter to
+ send_file_name */
+ recurse = 1;
send_file_name(f, flist, fname, 0, 0);
copy_links = copy_links_saved;
send_file_name(f, flist, fname, 0, 0);
copy_links = copy_links_saved;
+ recurse = recurse_saved;
*p = '/';
}
} else {
*p = '/';
}
} else {