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
This commit is contained in:
Nick Mathewson
2007-09-18 15:53:55 +00:00
parent a2b76befff
commit f45dec1690
3 changed files with 28 additions and 2 deletions
+12
View File
@@ -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());