diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-10-31 16:44:14 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2014-07-25 11:59:00 -0400 |
commit | e001610c99bea661dbefc693ec173a90fcb3ee5e (patch) | |
tree | febcb653448a7a68c8d3c967d9296fa11a762574 /src | |
parent | 1b551823de6e6c03cf86bcbb7ca1b687c5f16ea6 (diff) | |
download | tor-e001610c99bea661dbefc693ec173a90fcb3ee5e.tar.gz tor-e001610c99bea661dbefc693ec173a90fcb3ee5e.zip |
Implement proposal 221: Stop sending CREATE_FAST
This makes FastFirstHopPK an AUTOBOOL; makes the default "auto"; and
makes the behavior of "auto" be "look at the consensus."
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitbuild.c | 8 | ||||
-rw-r--r-- | src/or/config.c | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 2b4d3c3118..4603de071f 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -663,16 +663,18 @@ should_use_create_fast_for_circuit(origin_circuit_t *circ) if (!circ->cpath->extend_info->onion_key) return 1; /* our hand is forced: only a create_fast will work. */ - if (!options->FastFirstHopPK) - return 0; /* we prefer to avoid create_fast */ if (public_server_mode(options)) { /* We're a server, and we know an onion key. We can choose. * Prefer to blend our circuit into the other circuits we are * creating on behalf of others. */ return 0; } + if (options->FastFirstHopPK == -1) { + /* option is "auto", so look at the consensus. */ + return networkstatus_get_param(NULL, "usecreatefast", 1, 0, 1); + } - return 1; + return options->FastFirstHopPK; } /** Return true if <b>circ</b> is the type of circuit we want to count diff --git a/src/or/config.c b/src/or/config.c index a2811ebc21..1de91878b7 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -236,7 +236,7 @@ static config_var_t option_vars_[] = { OBSOLETE("FallbackNetworkstatusFile"), V(FascistFirewall, BOOL, "0"), V(FirewallPorts, CSV, ""), - V(FastFirstHopPK, BOOL, "1"), + V(FastFirstHopPK, AUTOBOOL, "auto"), V(FetchDirInfoEarly, BOOL, "0"), V(FetchDirInfoExtraEarly, BOOL, "0"), V(FetchServerDescriptors, BOOL, "1"), |