diff --git a/ChangeLog b/ChangeLog index 6ef6761bb9..d4f90346cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,6 +17,8 @@ Changes in version 0.2.0.3-alpha - 2007-??-?? from Robert Hogan.) - Add a RESOLVE command to launch hostname lookups. (Original patch from Robert Hogan.) + - Add GETINFO status/enough-dir-info to let controllers tell whether + Tor has downloaded sufficient directory information. (Patch from Tup.) o Performance improvements (win32): - Use Critical Sections rather than Mutexes for synchronizing threads diff --git a/doc/spec/control-spec.txt b/doc/spec/control-spec.txt index a84250c231..e3725e5fce 100644 --- a/doc/spec/control-spec.txt +++ b/doc/spec/control-spec.txt @@ -484,6 +484,7 @@ $Id$ an empty string. "status/circuit-established" + "status/enough-dir-info" "status/..." These provide the current internal Tor values for various Tor states. See Section 4.1.10 for explanations. (Only a few of the @@ -695,6 +696,8 @@ $Id$ request is done in the background: to see the answers, your controller will need to listen for ADDRMAP events; see 4.1.7 below. + [Added in Tor 0.2.0.3-alpha] + 4. Replies Reply codes follow the same 3-character format as used by SMTP, with the diff --git a/src/or/control.c b/src/or/control.c index 055d278d23..71be8a5685 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1483,6 +1483,8 @@ getinfo_helper_events(control_connection_t *control_conn, * to be a status GETINFO if there's a corresponding STATUS event. */ if (!strcmp(question, "status/circuit-established")) { *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 (!strcmpstart(question, "status/version/")) { combined_version_status_t st; int is_server = server_mode(get_options()); @@ -1595,6 +1597,9 @@ static const getinfo_item_t getinfo_items[] = { PREFIX("status/", events, NULL), DOC("status/circuit-established", "Whether we think client functionality is working."), + DOC("status/enough-dir-info", + "Whether we have enough up-to-date directory information to build " + "circuits."), /* DOCDOC specify status/version/ */ DOC("status/version/recommended", "List of currently recommended versions."), DOC("status/version/current", "Status of the current version."),