]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
let the NumNTorsPerTAP consensus param override our queue choice
authorRoger Dingledine <arma@torproject.org>
Wed, 4 Sep 2013 00:58:15 +0000 (20:58 -0400)
committerRoger Dingledine <arma@torproject.org>
Thu, 5 Sep 2013 03:21:45 +0000 (23:21 -0400)
src/or/onion.c

index 639481bfe1861fe52b7fd90240bb93f1fa01585a..4ea2061ef3fcb4582bc32cbaebf9b354e43af517 100644 (file)
@@ -14,6 +14,7 @@
 #include "circuitlist.h"
 #include "config.h"
 #include "cpuworker.h"
+#include "networkstatus.h"
 #include "onion.h"
 #include "onion_fast.h"
 #include "onion_ntor.h"
@@ -171,8 +172,14 @@ onion_pending_add(or_circuit_t *circ, create_cell_t *onionskin)
 static int
 num_ntors_per_tap(void)
 {
-#define NUM_NTORS_PER_TAP 5
-  return NUM_NTORS_PER_TAP;
+#define DEFAULT_NUM_NTORS_PER_TAP 10
+#define MIN_NUM_NTORS_PER_TAP 0
+#define MAX_NUM_NTORS_PER_TAP 100000
+
+  return networkstatus_get_param(NULL, "NumNTorsPerTAP",
+                                 DEFAULT_NUM_NTORS_PER_TAP,
+                                 MIN_NUM_NTORS_PER_TAP,
+                                 MAX_NUM_NTORS_PER_TAP);
 }
 
 /** Choose which onion queue we'll pull from next. If one is empty choose