diff options
author | Roger Dingledine <arma@torproject.org> | 2009-10-14 17:07:32 -0400 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2009-10-14 17:07:32 -0400 |
commit | 23943364263b8cb38e81a63715f872691269d5ed (patch) | |
tree | 263f2411ed01a8f25307a33b00197141657f0f3e /src/or/networkstatus.c | |
parent | 83c3f118db0ae3911ea72403856df9fb08b2d0e5 (diff) | |
download | tor-23943364263b8cb38e81a63715f872691269d5ed.tar.gz tor-23943364263b8cb38e81a63715f872691269d5ed.zip |
read the "circwindow" parameter from the consensus
backport of c43859c5c12361fad505
backport of 0d13e0ed145f4c1b5bd1
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 05da73b5cb..f4a0761f7b 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -1889,14 +1889,18 @@ networkstatus_dump_bridge_status_to_file(time_t now) } /** Return the value of a integer parameter from the networkstatus <b>ns</b> - * whose name is <b>param_name</b>. Return <b>default_val</b> if ns is NULL, - * or if it has no parameter called <b>param_name</b>. */ + * whose name is <b>param_name</b>. If <b>ns</b> is NULL, try loading the + * latest consensus ourselves. Return <b>default_val</b> if no latest + * consensus, or if it has no parameter called <b>param_name</b>. */ int32_t networkstatus_get_param(networkstatus_t *ns, const char *param_name, int32_t default_val) { size_t name_len; + if (!ns) /* if they pass in null, go find it ourselves */ + ns = networkstatus_get_latest_consensus(); + if (!ns || !ns->net_params) return default_val; |