summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-09-18 15:53:55 +0000
committerNick Mathewson <nickm@torproject.org>2007-09-18 15:53:55 +0000
commitf45dec169030b4047028c04fb21e9d98a3e59dac (patch)
treec038069bea5d27fccca098464d420234594e2825
parenta2b76beffffe8f817d7b21faa73be66745d9cd5a (diff)
downloadtor-f45dec169030b4047028c04fb21e9d98a3e59dac.tar.gz
tor-f45dec169030b4047028c04fb21e9d98a3e59dac.zip
r15143@catbus: nickm | 2007-09-18 11:49:46 -0400
Add getinfo status/good-server-descriptor and status/reachability-succeeded. Patch from Robert Hogan. svn:r11483
-rw-r--r--ChangeLog3
-rw-r--r--doc/spec/control-spec.txt15
-rw-r--r--src/or/control.c12
3 files changed, 28 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 564d747db3..b8fd0c5524 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,9 @@ Changes in version 0.2.0.7-alpha - 2007-??-??
o Minor features (controller):
- Accept LF instead of CRLF on controller, since some software has a
hard time generating real Internet newlines.
+ - Add GETINFO values for the server status events
+ "REACHABILITY_SUCCEEDED" and "GOOD_SERVER_DESCRIPTOR". Patch from
+ Robert Hogan.
o Removed features:
- Routers no longer include bandwidth-history lines in their
diff --git a/doc/spec/control-spec.txt b/doc/spec/control-spec.txt
index 4d8946b93c..9b250758f0 100644
--- a/doc/spec/control-spec.txt
+++ b/doc/spec/control-spec.txt
@@ -524,11 +524,21 @@ $Id$
"status/circuit-established"
"status/enough-dir-info"
+ "status/good-server-descriptor"
"status/..."
These provide the current internal Tor values for various Tor
states. See Section 4.1.10 for explanations. (Only a few of the
status events are available as getinfo's currently. Let us know if
- you want more exposed.)
+ you want more exposed.)<
+ "status/reachability/or"
+ 0 or 1, depending on whether we've found our ORPort reachable.
+ "status/reachability/dir"
+ 0 or 1, depending on whether we've found our DirPort reachable.
+ "status/reachability"
+ "OR=" ("0"/"1") SP "DIR=" ("0"/"1")
+ Combines status/reachability/*; controllers MUST ignore unrecognized
+ elements in this entry.
+
"status/version/recommended" -- List of currently recommended versions
"status/version/current" -- Status of the current version. One of:
new, old, unrecommended, recommended, new in series, obsolete.
@@ -1322,7 +1332,8 @@ $Id$
"ORADDRESS=IP:port"
"DIRADDRESS=IP:port"
We successfully verified the reachability of our external OR port or
- directory port.
+ directory port (depending on which of ORADDRESS or DIRADDRESS is
+ given.)
{This event could effect the controller's idea of server status, but
the controller should not interrupt the user to tell them so.}
diff --git a/src/or/control.c b/src/or/control.c
index adbfad7366..0faaa502a1 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1589,6 +1589,18 @@ getinfo_helper_events(control_connection_t *control_conn,
*answer = tor_strdup(has_completed_circuit ? "1" : "0");
} else if (!strcmp(question, "status/enough-dir-info")) {
*answer = tor_strdup(router_have_minimum_dir_info() ? "1" : "0");
+ } else if (!strcmp(question, "status/good-server-descriptor")) {
+ *answer = tor_strdup(directories_have_accepted_server_descriptor()
+ ? "1" : "0");
+ } else if (!strcmp(question, "status/reachability-succeeded/or")) {
+ *answer = tor_strdup(check_whether_orport_reachable() ? "1" : "0");
+ } else if (!strcmp(question, "status/reachability-succeeded/dir")) {
+ *answer = tor_strdup(check_whether_dirport_reachable() ? "1" : "0");
+ } else if (!strcmp(question, "status/reachability-succeeded")) {
+ *answer = tor_malloc(16);
+ tor_snprintf(*answer, 16, "OR=%d DIR=%d",
+ check_whether_orport_reachable() ? 1 : 0,
+ check_whether_dirport_reachable() ? 1 : 0);
} else if (!strcmpstart(question, "status/version/")) {
combined_version_status_t st;
int is_server = server_mode(get_options());