mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-05-19 12:25:42 -04:00
Allow --max-alloc=0 for unlimited.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
2
t_stub.c
2
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;
|
||||
|
||||
2
util2.c
2
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",
|
||||
|
||||
Reference in New Issue
Block a user