Removing vestigial support for protocol versions prior to 15.
authorJ.W. Schultz <jw@samba.org>
Mon, 31 Mar 2003 17:28:34 +0000 (17:28 +0000)
committerJ.W. Schultz <jw@samba.org>
Mon, 31 Mar 2003 17:28:34 +0000 (17:28 +0000)
checksum.c
compat.c
flist.c
generator.c
match.c
receiver.c
sender.c

index 3decf78..8e584fa 100644 (file)
@@ -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;
index 02f5028..f89fb51 100644 (file)
--- 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 2e11766..2fff9cf 100644 (file)
--- 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);
        }
 
index c098409..0dd8e7e 100644 (file)
@@ -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 37ba1a0..c330cd9 100644 (file)
--- 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);
index 3fa154a..27c0da3 100644 (file)
@@ -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)
index a42042b..93cf871 100644 (file)
--- 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);