From: Nick Mathewson Date: Fri, 1 Jul 2016 19:29:05 +0000 (-0400) Subject: Merge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed' X-Git-Tag: tor-0.2.9.1-alpha~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aaa31290431ea2cd1d1e8498dbe271eb53d2389d;p=thirdparty%2Ftor.git Merge remote-tracking branch 'dgoulet/ticket16943_029_05-squashed' Trivial Conflicts: src/or/or.h src/or/routerparse.c --- aaa31290431ea2cd1d1e8498dbe271eb53d2389d diff --cc src/or/networkstatus.c index 5415c30289,cf395f9c99..0dfb8afcce --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@@ -1216,56 -1189,10 +1226,56 @@@ consensus_is_waiting_for_certs(void ? 1 : 0; } +/** Look up the currently active (depending on bootstrap status) download + * status for this consensus flavor and return a pointer to it. + */ +MOCK_IMPL(download_status_t *, +networkstatus_get_dl_status_by_flavor,(consensus_flavor_t flavor)) +{ + download_status_t *dl = NULL; + const int we_are_bootstrapping = + networkstatus_consensus_is_bootstrapping(time(NULL)); + + if ((int)flavor <= N_CONSENSUS_FLAVORS) { + dl = &((we_are_bootstrapping ? + consensus_bootstrap_dl_status : consensus_dl_status)[flavor]); + } + + return dl; +} + +/** Look up the bootstrap download status for this consensus flavor + * and return a pointer to it. */ +MOCK_IMPL(download_status_t *, +networkstatus_get_dl_status_by_flavor_bootstrap,(consensus_flavor_t flavor)) +{ + download_status_t *dl = NULL; + + if ((int)flavor <= N_CONSENSUS_FLAVORS) { + dl = &(consensus_bootstrap_dl_status[flavor]); + } + + return dl; +} + +/** Look up the running (non-bootstrap) download status for this consensus + * flavor and return a pointer to it. */ +MOCK_IMPL(download_status_t *, +networkstatus_get_dl_status_by_flavor_running,(consensus_flavor_t flavor)) +{ + download_status_t *dl = NULL; + + if ((int)flavor <= N_CONSENSUS_FLAVORS) { + dl = &(consensus_dl_status[flavor]); + } + + return dl; +} + /** Return the most recent consensus that we have downloaded, or NULL if we * don't have one. */ - networkstatus_t * - networkstatus_get_latest_consensus(void) + MOCK_IMPL(networkstatus_t *, + networkstatus_get_latest_consensus,(void)) { return current_consensus; } diff --cc src/or/or.h index a1a0810e4b,1b7f1a8568..ed799b98ff --- a/src/or/or.h +++ b/src/or/or.h @@@ -4499,10 -4496,11 +4514,16 @@@ typedef struct /** Autobool: Do we try to retain capabilities if we can? */ int KeepBindCapabilities; + /** Maximum total size of unparseable descriptors to log during the + * lifetime of this Tor process. + */ + uint64_t MaxUnparseableDescSizeToLog; ++ + /** Bool (default: 1): Switch for the shared random protocol. Only + * relevant to a directory authority. If off, the authority won't + * participate in the protocol. If on (default), a flag is added to the + * vote indicating participation. */ + int AuthDirSharedRandomness; } or_options_t; /** Persistent state for an onion router, as saved to disk. */ diff --cc src/or/routerparse.c index d2579100a5,88cfbdc4f1..0f9b9f75b6 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@@ -28,7 -28,7 +28,8 @@@ #include "routerparse.h" #include "entrynodes.h" #include "torcert.h" +#include "sandbox.h" + #include "shared_random.h" #undef log #include