|
@@ -11,6 +11,7 @@
|
|
|
#include "connection.h"
|
|
|
#include "connection_edge.h"
|
|
|
#include "control.h"
|
|
|
+#define DIRECTORY_PRIVATE
|
|
|
#include "directory.h"
|
|
|
#include "dirserv.h"
|
|
|
#include "dirvote.h"
|
|
@@ -3778,7 +3779,8 @@ find_dl_min_and_max_delay(download_status_t *dls, const or_options_t *options,
|
|
|
|
|
|
/** Advance one delay step. The algorithm is to use the previous delay to
|
|
|
* compute an increment, we construct a value uniformly at random between
|
|
|
- * delay+1 and (delay*4)+1 (or *3 in test networks).
|
|
|
+ * delay+1 and (delay*(DIR_DEFAULT_RANDOM_MULTIPLIER+1))+1 (or
|
|
|
+ * DIR_TEST_NET_RANDOM_MULTIPLIER in test networks).
|
|
|
* We then clamp that value to be no larger than max_delay, and return it.
|
|
|
*
|
|
|
* Requires that delay is less than INT_MAX, and delay is in [0,max_delay].
|
|
@@ -3798,11 +3800,11 @@ next_random_exponential_delay(int delay, int max_delay)
|
|
|
|
|
|
/* How much are we willing to add to the delay? */
|
|
|
int max_increment;
|
|
|
- int multiplier = 3; /* no more than quadruple the previous delay */
|
|
|
+ int multiplier = DIR_DEFAULT_RANDOM_MULTIPLIER;
|
|
|
if (get_options()->TestingTorNetwork) {
|
|
|
/* Decrease the multiplier in testing networks. This reduces the variance,
|
|
|
* so that bootstrap is more reliable. */
|
|
|
- multiplier = 2; /* no more than triple the previous delay */
|
|
|
+ multiplier = DIR_TEST_NET_RANDOM_MULTIPLIER;
|
|
|
}
|
|
|
|
|
|
if (delay && delay < (INT_MAX-1) / multiplier) {
|