if the user passes a block size on the command line then don't adapt
authorAndrew Tridgell <tridge@samba.org>
Wed, 3 Jun 1998 02:35:51 +0000 (02:35 +0000)
committerAndrew Tridgell <tridge@samba.org>
Wed, 3 Jun 1998 02:35:51 +0000 (02:35 +0000)
the block size.

rsync.c

diff --git a/rsync.c b/rsync.c
index 72c7ce9..beb3d37 100644 (file)
--- a/rsync.c
+++ b/rsync.c
@@ -356,7 +356,11 @@ static int skip_file(char *fname,
 /* use a larger block size for really big files */
 int adapt_block_size(struct file_struct *file, int bsize)
 {
-       int ret = file->length / (10000); /* rough heuristic */
+       int ret;
+
+       if (bsize != BLOCK_SIZE) return bsize;
+
+       ret = file->length / (10000); /* rough heuristic */
        ret = ret & ~15; /* multiple of 16 */
        if (ret < bsize) ret = bsize;
        if (ret > CHUNK_SIZE/2) ret = CHUNK_SIZE/2;