summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorteor <teor2345@gmail.com>2014-12-26 00:43:58 +1100
committerNick Mathewson <nickm@torproject.org>2014-12-30 09:06:00 -0500
commitc3a4201faa389ce95b263045a855a556be25f3f2 (patch)
tree124ffafc6018c7074b5862344714b395d5cfc10b
parentcb94f7534dfd666eb02fd8560621d713177b0f62 (diff)
downloadtor-c3a4201faa389ce95b263045a855a556be25f3f2.tar.gz
tor-c3a4201faa389ce95b263045a855a556be25f3f2.zip
Add "internal" to some bootstrap statuses when no exits are available.
If the consensus does not contain Exits, Tor will only build internal circuits. In this case, relevant statuses will contain the word "internal" as indicated in the Tor control-spec.txt. When bootstrap completes, Tor will be ready to handle an application requesting an internal circuit to hidden services at ".onion" addresses. If a future consensus contains Exits, exit circuits may become available. Tor already notifies the user at "notice" level if they have no exits in the consensus, and can therefor only build internal paths. Consequential change from #13718.
-rw-r--r--changes/bug13718-add-internal-bootstrap-statuses9
-rw-r--r--src/or/control.c30
2 files changed, 34 insertions, 5 deletions
diff --git a/changes/bug13718-add-internal-bootstrap-statuses b/changes/bug13718-add-internal-bootstrap-statuses
new file mode 100644
index 0000000000..d3e9a7709c
--- /dev/null
+++ b/changes/bug13718-add-internal-bootstrap-statuses
@@ -0,0 +1,9 @@
+ o Minor bugfixes:
+ - Add "internal" to some bootstrap statuses when no exits are available.
+ If the consensus does not contain Exits, Tor will only build internal
+ circuits. In this case, relevant statuses will contain the word
+ "internal" as indicated in the Tor control-spec.txt. When bootstrap
+ completes, Tor will be ready to handle an application requesting an
+ internal circuit to hidden services at ".onion" addresses.
+ If a future consensus contains Exits, exit circuits may become available.
+ Consequential change from #13718.
diff --git a/src/or/control.c b/src/or/control.c
index dc67588d6a..7214559136 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4807,23 +4807,43 @@ bootstrap_status_to_string(bootstrap_status_t s, const char **tag,
break;
case BOOTSTRAP_STATUS_REQUESTING_DESCRIPTORS:
*tag = "requesting_descriptors";
- *summary = "Asking for relay descriptors";
+ /* XXXX this appears to incorrectly report internal on most loads */
+ *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+ "Asking for relay descriptors for internal paths" :
+ "Asking for relay descriptors";
break;
+ /* If we're sure there are no exits in the consensus,
+ * inform the controller by adding "internal"
+ * to the status summaries.
+ * (We only check this while loading descriptors,
+ * so we may not know in the earlier stages.)
+ * But if there are exits, we can't be sure whether
+ * we're creating internal or exit paths/circuits.
+ * XXXX Or should be use different tags or statuses
+ * for internal and exit/all? */
case BOOTSTRAP_STATUS_LOADING_DESCRIPTORS:
*tag = "loading_descriptors";
- *summary = "Loading relay descriptors";
+ *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+ "Loading relay descriptors for internal paths" :
+ "Loading relay descriptors";
break;
case BOOTSTRAP_STATUS_CONN_OR:
*tag = "conn_or";
- *summary = "Connecting to the Tor network";
+ *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+ "Connecting to the Tor network internally" :
+ "Connecting to the Tor network";
break;
case BOOTSTRAP_STATUS_HANDSHAKE_OR:
*tag = "handshake_or";
- *summary = "Finishing handshake with first hop";
+ *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+ "Finishing handshake with first hop of internal circuit" :
+ "Finishing handshake with first hop";
break;
case BOOTSTRAP_STATUS_CIRCUIT_CREATE:
*tag = "circuit_create";
- *summary = "Establishing a Tor circuit";
+ *summary = router_have_consensus_path() == CONSENSUS_PATH_INTERNAL ?
+ "Establishing an internal Tor circuit" :
+ "Establishing a Tor circuit";
break;
case BOOTSTRAP_STATUS_DONE:
*tag = "done";