summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-12 13:29:53 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-12 13:29:53 -0500
commitedc87b263f09d09eb96599fde27cd82d7ea5aa13 (patch)
treefb4061f56793941d073233200df820f8fd15f99a /src
parent1f65a2310a986a6067348b0a1f440d69b28dcbe7 (diff)
parent06368e531097d3b973f1f052e77e7ffdecde1b70 (diff)
downloadtor-edc87b263f09d09eb96599fde27cd82d7ea5aa13.tar.gz
tor-edc87b263f09d09eb96599fde27cd82d7ea5aa13.zip
Merge remote-tracking branch 'ffmancera/bug24861'
Diffstat (limited to 'src')
-rw-r--r--src/common/torint.h10
-rw-r--r--src/or/circuitlist.c11
2 files changed, 17 insertions, 4 deletions
diff --git a/src/common/torint.h b/src/common/torint.h
index bc81c114f8..0b8061d24f 100644
--- a/src/common/torint.h
+++ b/src/common/torint.h
@@ -348,6 +348,16 @@ typedef uint32_t uintptr_t;
#endif /* (SIZEOF_SIZE_T == 4) || ... */
#endif /* !defined(SIZE_MAX) */
+#ifdef _WIN32
+# ifdef _WIN64
+# define TOR_PRIuSZ PRIu64
+# else
+# define TOR_PRIuSZ PRIu32
+# endif
+#else
+# define TOR_PRIuSZ "zu"
+#endif
+
#ifndef SSIZE_MAX
#if (SIZEOF_SIZE_T == 4)
#define SSIZE_MAX INT32_MAX
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 661438d8f1..028fdbfc2f 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -51,6 +51,8 @@
* logic, which was originally circuit-focused.
**/
#define CIRCUITLIST_PRIVATE
+#include "torint.h" /* TOR_PRIuSZ */
+
#include "or.h"
#include "channel.h"
#include "circpathbias.h"
@@ -2404,10 +2406,11 @@ circuits_handle_oom(size_t current_allocation)
int n_circuits_killed=0;
int n_dirconns_killed=0;
uint32_t now_ts;
- log_notice(LD_GENERAL, "We're low on memory (cell queues total alloc: %zu,"
- " buffer total alloc: %zu, tor compress total alloc: %zu,"
- " rendezvous cache total alloc: %zu). Killing circuits with"
- " over-long queues. (This behavior is controlled by"
+ log_notice(LD_GENERAL, "We're low on memory (cell queues total alloc:"
+ " %"TOR_PRIuSZ" buffer total alloc: %" TOR_PRIuSZ ","
+ " tor compress total alloc: %" TOR_PRIuSZ
+ " rendezvous cache total alloc: %" TOR_PRIuSZ "). Killing"
+ " circuits withover-long queues. (This behavior is controlled by"
" MaxMemInQueues.)",
cell_queues_get_total_allocation(),
buf_get_total_allocation(),