mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-23 20:03:31 +01:00
Use tor_asprintf for in have_enough_mem_for_dircache()
(Fixes bug 20887)
This commit is contained in:
parent
b0f0c0f550
commit
bc5f79b95c
4
changes/bug20887
Normal file
4
changes/bug20887
Normal file
@ -0,0 +1,4 @@
|
||||
o Minor bugfixes (freebsd):
|
||||
- In have_enough_mem_for_dircache(), the variable DIRCACHE_MIN_MEM_MB
|
||||
does not stringify on FreeBSD, so we switch to tor_asprintf(). Fixes
|
||||
bug 20887; bugfix on 0.2.8.1-alpha. Patch by Neel Chauhan.
|
@ -4625,15 +4625,14 @@ have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem,
|
||||
if (options->DirCache) {
|
||||
if (total_mem < DIRCACHE_MIN_MEM_BYTES) {
|
||||
if (options->BridgeRelay) {
|
||||
*msg = tor_strdup("Running a Bridge with less than "
|
||||
STRINGIFY(DIRCACHE_MIN_MEM_MB) " MB of memory is not "
|
||||
"recommended.");
|
||||
tor_asprintf(msg, "Running a Bridge with less than %d MB of memory "
|
||||
"is not recommended.", DIRCACHE_MIN_MEM_MB);
|
||||
} else {
|
||||
*msg = tor_strdup("Being a directory cache (default) with less than "
|
||||
STRINGIFY(DIRCACHE_MIN_MEM_MB) " MB of memory is not "
|
||||
"recommended and may consume most of the available "
|
||||
"resources, consider disabling this functionality by "
|
||||
"setting the DirCache option to 0.");
|
||||
tor_asprintf(msg, "Being a directory cache (default) with less than "
|
||||
"%d MB of memory is not recommended and may consume "
|
||||
"most of the available resources. Consider disabling "
|
||||
"this functionality by setting the DirCache option "
|
||||
"to 0.", DIRCACHE_MIN_MEM_MB);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user