diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-08 07:12:07 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-08 07:12:07 -0500 |
commit | 7ed7d0571404ebd91698cc3f255d6aa1e547dfff (patch) | |
tree | 9134b715b591795c5d349ab278ae0ef0f065d951 | |
parent | 2b2a44a838d1bc778c9e47b4622aa41b2d4a8f4f (diff) | |
parent | 38e3f91c6388bc676c0007b009488ffcc2496bc8 (diff) | |
download | tor-7ed7d0571404ebd91698cc3f255d6aa1e547dfff.tar.gz tor-7ed7d0571404ebd91698cc3f255d6aa1e547dfff.zip |
Merge branch 'maint-0.2.9' into release-0.2.9
-rw-r--r-- | changes/bug20597 | 5 | ||||
-rw-r--r-- | src/or/directory.c | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/changes/bug20597 b/changes/bug20597 new file mode 100644 index 0000000000..f199b63933 --- /dev/null +++ b/changes/bug20597 @@ -0,0 +1,5 @@ + o Minor bugfixes (test networks, exponential backoff): + - When using exponential backoff in test networks, use a lower exponent, + so the delays do not vary as much. This helps test networks bootstrap + consistently. Fixes bug 20597; bugfix on 20499; not in any released + version of tor. diff --git a/src/or/directory.c b/src/or/directory.c index 1f399818c4..f4fd521929 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -3796,7 +3796,12 @@ next_random_exponential_delay(int delay, int max_delay) /* How much are we willing to add to the delay? */ int max_increment; - const int multiplier = 3; /* no more than quadruple the previous delay */ + int multiplier = 3; /* no more than quadruple the previous delay */ + 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 */ + } if (delay && delay < (INT_MAX-1) / multiplier) { max_increment = delay * multiplier; |