X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/9b3318b0df79ce6e9490c744ef7ae0707bd91599..2c713fcdfa04eb7d58c67a4a51d4cbdc37f78536:/options.c diff --git a/options.c b/options.c index 3485a426..47bba714 100644 --- a/options.c +++ b/options.c @@ -635,18 +635,34 @@ int parse_arguments(int *argc, const char ***argv, int frommain) } #endif + if (block_size > MAX_MAP_SIZE) { + rprintf(FINFO, "limiting block-size to %d bytes\n", + MAX_MAP_SIZE); + block_size = MAX_MAP_SIZE; + } + if (write_batch && read_batch) { rprintf(FERROR, "write-batch and read-batch can not be used together\n"); exit_cleanup(RERR_SYNTAX); } - if ((write_batch || read_batch) && am_server) { - rprintf(FERROR, - "batch-mode is incompatible with server mode\n"); - /* We don't actually exit_cleanup(), so that we can still service - * older version clients that still send batch args to server. */ - read_batch = write_batch = 0; - batch_name = NULL; + if (write_batch || read_batch) { + if (dry_run) { + rprintf(FERROR, + "--%s-batch cannot be used with --dry_run (-n)\n", + write_batch ? "write" : "read"); + exit_cleanup(RERR_SYNTAX); + } + if (am_server) { + rprintf(FINFO, + "ignoring --%s-batch option sent to server\n", + write_batch ? "write" : "read"); + /* We don't actually exit_cleanup(), so that we can + * still service older version clients that still send + * batch args to server. */ + read_batch = write_batch = 0; + batch_name = NULL; + } } if (batch_name && strlen(batch_name) > MAX_BATCH_NAME_LEN) { rprintf(FERROR,