Commit bc63ae3f authored by J.W. Schultz's avatar J.W. Schultz

Removing vestigial support for protocol versions prior to 15.

parent 6e128863
......@@ -117,16 +117,6 @@ void file_checksum(char *fname,char *sum,OFF_T size)
}
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;
......
......@@ -65,18 +65,14 @@ void setup_protocol(int f_out,int f_in)
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();
}
......@@ -1042,7 +1042,7 @@ struct file_list *send_file_list(int f, int argc, char *argv[])
/* 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);
}
......@@ -1122,7 +1122,7 @@ struct file_list *recv_file_list(int 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);
}
......
......@@ -516,19 +516,16 @@ void generate_files(int f,struct file_list *flist,char *local_name,int f_recv)
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);
}
......@@ -24,8 +24,6 @@ extern int csum_length;
extern int verbose;
extern int am_server;
extern int remote_version;
typedef unsigned short tag;
#define TABLESIZE (1<<16)
......@@ -322,13 +320,11 @@ void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len)
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);
......
......@@ -306,15 +306,13 @@ static int receive_data(int f_in,struct map_struct *buf,int fd,char *fname,
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;
}
......@@ -353,7 +351,7 @@ int recv_files(int f_in,struct file_list *flist,char *local_name,int f_gen)
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)
......
......@@ -20,7 +20,6 @@
#include "rsync.h"
extern int verbose;
extern int remote_version;
extern int csum_length;
extern struct stats stats;
extern int io_error;
......@@ -118,7 +117,7 @@ void send_files(struct file_list *flist,int f_out,int f_in)
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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment