From bc63ae3f13e01874e375bb5cc606775889ed5afa Mon Sep 17 00:00:00 2001 From: "J.W. Schultz" Date: Mon, 31 Mar 2003 17:28:34 +0000 Subject: [PATCH] Removing vestigial support for protocol versions prior to 15. --- checksum.c | 10 ---------- compat.c | 16 ++++++---------- flist.c | 4 ++-- generator.c | 23 ++++++++++------------- match.c | 14 +++++--------- receiver.c | 18 ++++++++---------- sender.c | 3 +-- 7 files changed, 32 insertions(+), 56 deletions(-) diff --git a/checksum.c b/checksum.c index 3decf78b..8e584fab 100644 --- a/checksum.c +++ b/checksum.c @@ -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; diff --git a/compat.c b/compat.c index 02f5028f..f89fb513 100644 --- a/compat.c +++ b/compat.c @@ -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(); } diff --git a/flist.c b/flist.c index 2e11766c..2fff9cf1 100644 --- a/flist.c +++ b/flist.c @@ -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); } diff --git a/generator.c b/generator.c index c0984098..0dd8e7ed 100644 --- a/generator.c +++ b/generator.c @@ -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); } diff --git a/match.c b/match.c index 37ba1a0c..c330cd9a 100644 --- a/match.c +++ b/match.c @@ -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); diff --git a/receiver.c b/receiver.c index 3fa154a7..27c0da36 100644 --- a/receiver.c +++ b/receiver.c @@ -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) diff --git a/sender.c b/sender.c index a42042b8..93cf8716 100644 --- a/sender.c +++ b/sender.c @@ -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); -- 2.34.1