config.status
dist.tar.gz
rsync
-rsync-0.1
-rsync-0.1
-rsync-0.1
-rsync-0.1.tar.gz
-rsync-0.2
-rsync-0.2
-rsync-0.2.tar.gz
-rsync-0.3
-rsync-0.3
-rsync-0.3.tar.gz
-rsync-0.4
-rsync-0.4
-rsync-0.4.tar.gz
-rsync-0.5
-rsync-0.5
-rsync-0.5
-rsync-0.5
-rsync-0.5
-rsync-0.5
-rsync-0.5
-rsync-0.5
-rsync-0.5.tar.gz
-rsync-0.6
-rsync-0.7
-rsync-0.7
-rsync-0.8
-rsync-0.8
-rsync-0.8
-rsync-0.8
-rsync-0.8.tar.gz
-rsync-0.9
-rsync-0.9.tar.gz
-rsync-1.0
-rsync-1.1
-rsync-1.1.tar.gz
-rsync-1.2
-rsync-1.2.tar.gz
-rsync-1.3
-rsync-1.4
-rsync-1.4.1
-rsync-1.4.1.tar.gz
-rsync-1.4.2
-rsync-1.4.2.tar.gz
-rsync-1.4.3
-rsync-1.4.4
-rsync-1.4.5
-rsync-1.4.5.tar.gz
-rsync-1.4.tar.gz
-rsync-ERSION
+rsync-*
rsync.aux
rsync.dvi
rsync.log
tech_report.log
tech_report.ps
test
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#include "rsync.h"
-int csum_length=SUM_LENGTH;
+int csum_length=2; /* initial value */
#define CSUM_CHUNK 64
s1 = s2 = 0;
for (i = 0; i < (len-4); i+=4) {
- s2 += 4*(s1 + buf[i]) + 3*buf[i+1] + 2*buf[i+2] + buf[i+3];
- s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3]);
+ s2 += 4*(s1 + buf[i]) + 3*buf[i+1] + 2*buf[i+2] + buf[i+3] + 10;
+ s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3] + 4);
}
for (; i < len; i++) {
- s1 += buf[i]; s2 += s1;
+ s1 += (buf[i]+1); s2 += s1;
}
return (s1 & 0xffff) + (s2 << 16);
}
/* Trim off the first byte from the checksum */
map = window_ptr(buf,offset,k+1);
- s1 -= map[0];
- s2 -= k * map[0];
+ s1 -= map[0] + 1;
+ s2 -= k * (map[0]+1);
/* Add on the next byte (if there is one) to the checksum */
if (k < (len-offset)) {
- s1 += map[k];
+ s1 += (map[k]+1);
s2 += s1;
} else {
--k;
void match_sums(int f,struct sum_struct *s,struct map_struct *buf,off_t len)
{
- char file_sum[SUM_LENGTH];
+ char file_sum[MD4_SUM_LENGTH];
last_match = 0;
false_alarms = 0;
if (remote_version >= 14) {
if (verbose > 2)
fprintf(FERROR,"sending file_sum\n");
- write_buf(f,file_sum,SUM_LENGTH);
+ write_buf(f,file_sum,MD4_SUM_LENGTH);
}
if (targets) {
struct stat st;
struct map_struct *buf;
struct sum_struct *s;
- char sum[SUM_LENGTH];
+ char sum[MD4_SUM_LENGTH];
int statret;
struct file_struct *file = &flist->files[i];
off_t offset = 0;
off_t offset2;
char *data;
- static char file_sum1[SUM_LENGTH];
- static char file_sum2[SUM_LENGTH];
+ static char file_sum1[MD4_SUM_LENGTH];
+ static char file_sum2[MD4_SUM_LENGTH];
char *map=NULL;
count = read_int(f_in);
sum_end(file_sum1);
if (remote_version >= 14) {
- read_buf(f_in,file_sum2,SUM_LENGTH);
+ read_buf(f_in,file_sum2,MD4_SUM_LENGTH);
if (verbose > 2)
fprintf(FERROR,"got file_sum\n");
- if (memcmp(file_sum1,file_sum2,SUM_LENGTH) != 0)
+ if (memcmp(file_sum1,file_sum2,MD4_SUM_LENGTH) != 0)
return 0;
}
return 1;
#endif
/* the length of the md4 checksum */
+#define MD4_SUM_LENGTH 16
#define SUM_LENGTH 16
#ifndef MAXPATHLEN
char *name;
char *dir;
char *link;
- char sum[SUM_LENGTH];
+ char sum[MD4_SUM_LENGTH];
};
struct file_list {
int len; /* length of chunk of file */
int i; /* index of this chunk */
uint32 sum1; /* simple checksum */
- char sum2[SUM_LENGTH]; /* md4 checksum */
+ char sum2[SUM_LENGTH]; /* checksum */
};
struct sum_struct {