max_alloc_arg = NULL;
}
if (max_alloc_arg) {
- ssize_t size = parse_size_arg(max_alloc_arg, 'B', "max-alloc", 1024*1024, False);
+ ssize_t size = parse_size_arg(max_alloc_arg, 'B', "max-alloc", 1024*1024, True);
if (size < 0)
return 0;
max_alloc = size;
letters can be any mix of upper and lower-case that you want to use.
Finally, if the string ends with either "+1" or "-1", it is offset by one
- byte in the indicated direction. The largest possible value is `8192P-1`.
+ byte in the indicated direction. The largest possible value is usually
+ `8192P-1`.
Examples: `--max-size=1.5mb-1` is 1499999 bytes, and `--max-size=2g+1` is
2147483649 bytes.
See the `--max-size` option for a description of how SIZE can be specified.
The default suffix if none is given is bytes.
+ Beginning in 3.2.3, a value of 0 specifies no limit.
+
You can set a default value using the environment variable RSYNC_MAX_ALLOC
using the same SIZE values as supported by this option. If the remote
rsync doesn't understand the `--max-alloc` option, you can override an
fractional value (e.g. "`--bwlimit=1.5m`"). If no suffix is specified, the
value will be assumed to be in units of 1024 bytes (as if "K" or "KiB" had
been appended). See the `--max-size` option for a description of all the
- available suffixes. A value of zero specifies no limit.
+ available suffixes. A value of 0 specifies no limit.
For backward-compatibility reasons, the rate limit will be rounded to the
nearest KiB unit, so no rate smaller than 1024 bytes per second is
int preserve_perms = 0;
int preserve_executability = 0;
int open_noatime = 0;
-size_t max_alloc = 1024*1024*1024; /* max_alloc is needed when combined with util2.o */
+size_t max_alloc = 0; /* max_alloc is needed when combined with util2.o */
char *partial_dir;
char *module_dir;
filter_rule_list daemon_filter_list;
void *my_alloc(void *ptr, size_t num, size_t size, const char *file, int line)
{
- if (num >= max_alloc/size) {
+ if (max_alloc && num >= max_alloc/size) {
if (!file)
return NULL;
rprintf(FERROR, "[%s] exceeded --max-alloc=%s setting (file=%s, line=%d)\n",