summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--options.c2
-rw-r--r--rsync.1.md7
-rw-r--r--t_stub.c2
-rw-r--r--util2.c2
4 files changed, 8 insertions, 5 deletions
diff --git a/options.c b/options.c
index 0b7b9f33..83146eef 100644
--- a/options.c
+++ b/options.c
@@ -1889,7 +1889,7 @@ int parse_arguments(int *argc_p, const char ***argv_p)
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;
diff --git a/rsync.1.md b/rsync.1.md
index 76b55367..3c856742 100644
--- a/rsync.1.md
+++ b/rsync.1.md
@@ -1741,7 +1741,8 @@ your home directory (remove the '=' for that).
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.
@@ -1772,6 +1773,8 @@ your home directory (remove the '=' for that).
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
@@ -3089,7 +3092,7 @@ your home directory (remove the '=' for that).
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
diff --git a/t_stub.c b/t_stub.c
index 954b86da..1e1e4046 100644
--- a/t_stub.c
+++ b/t_stub.c
@@ -33,7 +33,7 @@ int preserve_xattrs = 0;
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;
diff --git a/util2.c b/util2.c
index 181dbd7d..e7c70c1f 100644
--- a/util2.c
+++ b/util2.c
@@ -86,7 +86,7 @@ char *num_to_byte_string(ssize_t num)
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",