X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/73545f2ccb49d1bbada4240d1344041ecdc6c0ff..b98c7b81d2ca9191394a2fb47c7822de031f59c0:/checksum.c 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