aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-10-31 16:44:14 -0400
committerNick Mathewson <nickm@torproject.org>2013-11-01 10:04:48 -0400
commit0de71bf8eb5031b1c6539ea48627a938e200b5da (patch)
treee0c690019892551b5671e2c32047645c253f5274 /src/or/circuitbuild.c
parent5cc155e02a995fda828ff33b105040b2bd96a650 (diff)
downloadtor-0de71bf8eb5031b1c6539ea48627a938e200b5da.tar
tor-0de71bf8eb5031b1c6539ea48627a938e200b5da.tar.gz
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/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 43d2ffe4d..26c1e8982 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -600,16 +600,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