comparing checksums for the --checksum (-c) option.
char tmpchunk[CSUM_CHUNK];
struct mdfour m;
- memset(sum,0,csum_length);
+ memset(sum,0,MD4_SUM_LENGTH);
fd = open(fname,O_RDONLY);
if (fd == -1) return;
extern int am_server;
-extern int csum_length;
-
extern int preserve_links;
extern int preserve_perms;
extern int preserve_devices;
extern struct stats stats;
-extern int csum_length;
-
extern int verbose;
extern int am_server;
extern int 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;
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;
if (always_checksum && S_ISREG(st->st_mode)) {
char sum[MD4_SUM_LENGTH];
file_checksum(fname,sum,st->st_size);
- return (memcmp(sum,file->sum,csum_length) == 0);
+ if (remote_version < 21) {
+ return (memcmp(sum,file->sum,2) == 0);
+ } else {
+ return (memcmp(sum,file->sum,MD4_SUM_LENGTH) == 0);
+ }
}
if (size_only) {
static void send_sums(struct sum_struct *s,int f_out)
{
int i;
-
- /* tell the other guy how many we are going to be doing and how many
- bytes there are in the last chunk */
+
+ /* tell the other guy how many we are going to be doing and how many
+ bytes there are in the last chunk */
write_int(f_out,s?s->count:0);
write_int(f_out,s?s->n:block_size);
write_int(f_out,s?s->remainder:0);
- if (s)
- for (i=0;i<s->count;i++) {
- write_int(f_out,s->sums[i].sum1);
- write_buf(f_out,s->sums[i].sum2,csum_length);
- }
+
+ if (!s) return;
+
+ for (i=0;i<s->count;i++) {
+ write_int(f_out,s->sums[i].sum1);
+ write_buf(f_out,s->sums[i].sum2,csum_length);
+ }
}
struct stats stats;
-extern int csum_length;
-
extern int verbose;
static void report(int f)
#define SAME_TIME (1<<7)
/* update this if you make incompatible changes */
-#define PROTOCOL_VERSION 20
+#define PROTOCOL_VERSION 21
#define MIN_PROTOCOL_VERSION 11
#define MAX_PROTOCOL_VERSION 30