From: Andrew Tridgell Date: Tue, 2 Jul 1996 06:02:36 +0000 (+0000) Subject: save some more bytes by making the checksum smaller X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/commitdiff_plain/b98c7b81d2ca9191394a2fb47c7822de031f59c0 save some more bytes by making the checksum smaller --- diff --git a/checksum.c b/checksum.c index 809b09f9..2344b632 100644 --- a/checksum.c +++ b/checksum.c @@ -24,6 +24,7 @@ int csum_length=SUM_LENGTH; #define CSUM_CHUNK 64 int checksum_seed = 0; +extern int remote_version; /* a simple 32 bit checksum that can be upadted from either end @@ -127,6 +128,10 @@ 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; } @@ -180,22 +185,3 @@ void sum_end(char *sum) } -#ifdef CHECKSUM_MAIN - int main(int argc,char *argv[]) -{ - char sum[SUM_LENGTH]; - int i,j; - - checksum_init(); - - for (i=1;i