[tor-commits] [tor/master] Fix a couple of jenkins issues from 12538.

nickm at torproject.org nickm at torproject.org
Mon Dec 21 17:32:24 UTC 2015


commit 8ede8d411a29450a746efdfb950c916b0058b497
Author: Nick Mathewson <nickm at torproject.org>
Date:   Mon Dec 21 12:32:20 2015 -0500

    Fix a couple of jenkins issues from 12538.
---
 src/or/config.c     |    8 ++++++--
 src/test/include.am |    1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index ce7adba..53f2c76 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -4097,9 +4097,13 @@ have_enough_mem_for_dircache(const or_options_t *options, size_t total_mem,
                              char **msg)
 {
   *msg = NULL;
+  /* XXX We should possibly be looking at MaxMemInQueues here
+   * unconditionally.  Or we should believe total_mem unconditionally. */
   if (total_mem == 0) {
-    if (get_total_system_memory(&total_mem) < 0)
-      total_mem = options->MaxMemInQueues;
+    if (get_total_system_memory(&total_mem) < 0) {
+      total_mem = options->MaxMemInQueues >= SIZE_MAX ?
+        SIZE_MAX : options->MaxMemInQueues;
+    }
   }
   if (options->DirCache) {
     if (total_mem < DIRCACHE_MIN_BANDWIDTH) {
diff --git a/src/test/include.am b/src/test/include.am
index 44a2d86..786fb77 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -193,6 +193,7 @@ noinst_HEADERS+= \
 	src/test/rend_test_helpers.h \
 	src/test/test.h \
 	src/test/test_helpers.h \
+	src/test/test_dir_common.h \
 	src/test/test_descriptors.inc \
 	src/test/example_extrainfo.inc \
 	src/test/failing_routerdescs.inc \



More information about the tor-commits mailing list