}
-void checksum_init(void)
-{
- if (remote_version >= 14)
- csum_length = 2; /* adaptive */
- else
- csum_length = SUM_LENGTH;
-}
-
-
-
static int sumresidue;
static char sumrbuf[CSUM_CHUNK];
static struct mdfour md;
rprintf(FINFO,"%s is very old version of rsync, upgrade recommended.\n",
am_server ? "Server" : "Client");
- if (remote_version >= 12) {
- if (am_server) {
- if (read_batch || write_batch) /* dw */
+ if (am_server) {
+ if (read_batch || write_batch) /* dw */
checksum_seed = 32761;
- else
+ else
checksum_seed = time(NULL);
- write_int(f_out,checksum_seed);
- } else {
- checksum_seed = read_int(f_in);
- }
+ write_int(f_out,checksum_seed);
+ } else {
+ checksum_seed = read_int(f_in);
}
-
- checksum_init();
}
/* now send the uid/gid list. This was introduced in protocol
version 15 */
- if (f != -1 && remote_version >= 15) {
+ if (f != -1) {
send_uid_list(f);
}
}
/* now recv the uid/gid list. This was introduced in protocol version 15 */
- if (f != -1 && remote_version >= 15) {
+ if (f != -1) {
recv_uid_list(f, flist);
}
write_int(f,-1);
- if (remote_version >= 13) {
- /* in newer versions of the protocol the files can cycle through
- the system more than once to catch initial checksum errors */
- for (i=read_int(f_recv); i != -1; i=read_int(f_recv)) {
- struct file_struct *file = flist->files[i];
- recv_generator(local_name?local_name:f_name(file),
- flist,i,f);
- }
+ /* files can cycle through the system more than once
+ * to catch initial checksum errors */
+ for (i=read_int(f_recv); i != -1; i=read_int(f_recv)) {
+ struct file_struct *file = flist->files[i];
+ recv_generator(local_name?local_name:f_name(file), flist,i,f);
+ }
- phase++;
- if (verbose > 2)
- rprintf(FINFO,"generate_files phase=%d\n",phase);
+ phase++;
+ if (verbose > 2)
+ rprintf(FINFO,"generate_files phase=%d\n",phase);
- write_int(f,-1);
- }
+ write_int(f,-1);
}
extern int verbose;
extern int am_server;
-extern int remote_version;
-
typedef unsigned short tag;
#define TABLESIZE (1<<16)
sum_end(file_sum);
- if (remote_version >= 14) {
- if (verbose > 2)
- rprintf(FINFO,"sending file_sum\n");
- write_buf(f,file_sum,MD4_SUM_LENGTH);
- if (write_batch) /* dw */
- write_batch_delta_file(file_sum, MD4_SUM_LENGTH);
- }
+ if (verbose > 2)
+ rprintf(FINFO,"sending file_sum\n");
+ write_buf(f,file_sum,MD4_SUM_LENGTH);
+ if (write_batch) /* dw */
+ write_batch_delta_file(file_sum, MD4_SUM_LENGTH);
if (targets) {
free(targets);
sum_end(file_sum1);
- if (remote_version >= 14) {
- read_buf(f_in,file_sum2,MD4_SUM_LENGTH);
- if (verbose > 2) {
- rprintf(FINFO,"got file_sum\n");
- }
- if (fd != -1 &&
- memcmp(file_sum1,file_sum2,MD4_SUM_LENGTH) != 0) {
- return 0;
- }
+ read_buf(f_in,file_sum2,MD4_SUM_LENGTH);
+ if (verbose > 2) {
+ rprintf(FINFO,"got file_sum\n");
+ }
+ if (fd != -1
+ && memcmp(file_sum1,file_sum2,MD4_SUM_LENGTH) != 0) {
+ return 0;
}
return 1;
}
i = read_int(f_in);
if (i == -1) {
- if (phase==0 && remote_version >= 13) {
+ if (phase==0) {
phase++;
csum_length = SUM_LENGTH;
if (verbose > 2)
#include "rsync.h"
extern int verbose;
-extern int remote_version;
extern int csum_length;
extern struct stats stats;
extern int io_error;
i = read_int(f_in);
if (i == -1) {
- if (phase==0 && remote_version >= 13) {
+ if (phase==0) {
phase++;
csum_length = SUM_LENGTH;
write_int(f_out,-1);