summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-06-10 00:32:31 +0000
committerRoger Dingledine <arma@torproject.org>2006-06-10 00:32:31 +0000
commit6ea2ac053916490e9e8982498d1d2c949c7d9a40 (patch)
treee51834340630b69f52ba9042387059a404e6e613 /src
parent1db2c714db2ad367d0529ef2ceee319f4e632b5e (diff)
downloadtor-6ea2ac053916490e9e8982498d1d2c949c7d9a40.tar.gz
tor-6ea2ac053916490e9e8982498d1d2c949c7d9a40.zip
backport TestVia, but don't add it to the man page.
svn:r6584
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c3
-rw-r--r--src/or/config.c3
-rw-r--r--src/or/or.h1
3 files changed, 6 insertions, 1 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 63c942b65f..ae0139a76d 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -1501,7 +1501,8 @@ choose_good_middle_server(uint8_t purpose,
}
}
choice = router_choose_random_node(
- NULL, get_options()->ExcludeNodes, excluded,
+ purpose == CIRCUIT_PURPOSE_TESTING ? get_options()->TestVia : NULL,
+ get_options()->ExcludeNodes, excluded,
state->need_uptime, state->need_capacity, 0,
get_options()->_AllowInvalid & ALLOW_INVALID_MIDDLE, 0);
smartlist_free(excluded);
diff --git a/src/or/config.c b/src/or/config.c
index e166177543..9ca86243e3 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -233,6 +233,7 @@ static config_var_t _option_vars[] = {
VAR("StrictExitNodes", BOOL, StrictExitNodes, "0"),
VAR("SysLog", LINELIST_S, OldLogOptions, NULL),
VAR("TestSocks", BOOL, TestSocks, "0"),
+ VAR("TestVia", STRING, TestVia, NULL),
VAR("TrackHostExits", CSV, TrackHostExits, NULL),
VAR("TrackHostExitsExpire",INTERVAL, TrackHostExitsExpire, "30 minutes"),
OBSOLETE("TrafficShaping"),
@@ -2425,6 +2426,8 @@ options_validate(or_options_t *old_options, or_options_t *options,
return -1;
if (check_nickname_list(options->RendNodes, "RendExcludeNodes", msg))
return -1;
+ if (check_nickname_list(options->TestVia, "TestVia", msg))
+ return -1;
if (check_nickname_list(options->MyFamily, "MyFamily", msg))
return -1;
for (cl = options->NodeFamilies; cl; cl = cl->next) {
diff --git a/src/or/or.h b/src/or/or.h
index 1bbc55e8c2..286f7a0998 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1342,6 +1342,7 @@ typedef struct {
int NumCpus; /**< How many CPUs should we try to use? */
int RunTesting; /**< If true, create testing circuits to measure how well the
* other ORs are running. */
+ char *TestVia; /**< When reachability testing, use these as middle hop. */
config_line_t *RendConfigLines; /**< List of configuration lines
* for rendezvous services. */
char *ContactInfo; /**< Contact info to be published in the directory */