]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
7 years agoTest early-consensus clock skew warnings
Taylor Yu [Fri, 4 May 2018 02:53:24 +0000 (21:53 -0500)] 
Test early-consensus clock skew warnings

7 years agoAdd expect_no_log_msg_containing()
Taylor Yu [Fri, 4 May 2018 02:49:19 +0000 (21:49 -0500)] 
Add expect_no_log_msg_containing()

7 years agoMake clock_skew_warning() mockable
Taylor Yu [Fri, 4 May 2018 01:57:07 +0000 (20:57 -0500)] 
Make clock_skew_warning() mockable

7 years agotests: Add "now" param to construct_consensus()
Taylor Yu [Thu, 3 May 2018 20:24:31 +0000 (15:24 -0500)] 
tests: Add "now" param to construct_consensus()

construct_consensus() in test_routerlist.c created votes using a
timestamp from time().  Tests that called construct_consensus() might
have nondeterministic results if they rely on time() not changing too
much on two successive calls.

Neither existing of the two existing tests that calls
construct_consensus is likely to have a failure due to this problem.

7 years agoUpdate rust submodule.
Nick Mathewson [Tue, 8 May 2018 22:51:31 +0000 (18:51 -0400)] 
Update rust submodule.

7 years agorust: Add crypto crate and implement Rust wrappers for SHA2 code.
Isis Lovecruft [Sat, 21 Apr 2018 01:01:04 +0000 (01:01 +0000)] 
rust: Add crypto crate and implement Rust wrappers for SHA2 code.

 * FIXES #24659: https://bugs.torproject.org/24659

7 years agoMerge branch 'bug26004_029_squashed'
Nick Mathewson [Tue, 8 May 2018 18:26:05 +0000 (14:26 -0400)] 
Merge branch 'bug26004_029_squashed'

7 years agoAdd a changes file for ticket 26004.
Nick Mathewson [Mon, 7 May 2018 17:57:14 +0000 (13:57 -0400)] 
Add a changes file for ticket 26004.

7 years agoAvoid unsigned integer underflow on empty input.
Nick Mathewson [Mon, 7 May 2018 17:56:39 +0000 (13:56 -0400)] 
Avoid unsigned integer underflow on empty input.

7 years agoAllow bandwidth-file lines to have node_id in the last position
juga0 [Thu, 3 May 2018 08:29:57 +0000 (08:29 +0000)] 
Allow bandwidth-file lines to have node_id in the last position

Closes ticket 26004.

7 years agoMerge remote-tracking branch 'mikeperry/bug25870_rebase'
Nick Mathewson [Tue, 8 May 2018 18:12:29 +0000 (14:12 -0400)] 
Merge remote-tracking branch 'mikeperry/bug25870_rebase'

7 years agoMerge branch 'ticket26008'
Nick Mathewson [Tue, 8 May 2018 18:09:38 +0000 (14:09 -0400)] 
Merge branch 'ticket26008'

7 years agoMerge branch 'maint-0.3.3'
Roger Dingledine [Tue, 8 May 2018 17:49:56 +0000 (13:49 -0400)] 
Merge branch 'maint-0.3.3'

7 years agomanpage fix to stop saying CacheIPv4DNS is on by default
Roger Dingledine [Tue, 8 May 2018 17:13:45 +0000 (13:13 -0400)] 
manpage fix to stop saying CacheIPv4DNS is on by default

Stop saying in the manual that clients cache ipv4 dns answers from exit
relays. We haven't used them since 0.2.6.3-alpha, and in ticket 24050
we stopped even caching them as of 0.3.2.6-alpha, but we forgot to say
so in the man page.

Fixes bug 26052; bugfix on 0.3.2.6-alpha.

7 years agoBug 25870: Mention path restriction differences in manpage.
Mike Perry [Tue, 8 May 2018 16:35:20 +0000 (16:35 +0000)] 
Bug 25870: Mention path restriction differences in manpage.

7 years agominor cleanups on commit 17daab76
Roger Dingledine [Tue, 8 May 2018 16:21:24 +0000 (12:21 -0400)] 
minor cleanups on commit 17daab76

better punctuation and clearer wording

7 years agoMerge remote-tracking branch 'catalyst-github/bug26036'
Nick Mathewson [Mon, 7 May 2018 18:38:26 +0000 (14:38 -0400)] 
Merge remote-tracking branch 'catalyst-github/bug26036'

7 years agoRestore sys/random.h inclusion for getentropy()
Taylor Yu [Mon, 7 May 2018 17:43:39 +0000 (12:43 -0500)] 
Restore sys/random.h inclusion for getentropy()

Code movement for the refactoring for ticket 24658 didn't copy the
inclusion of sys/random.h, which is needed to get a prototype for
getentropy() on macOS 10.12 Sierra.  It also didn't copy the inclusion
of sys/syscall.h, which might prevent the getrandom() syscall from
being properly detected.  Move these inclusions.  Bug not in any
released Tor.

7 years agoMerge branch 'maint-0.3.3'
Nick Mathewson [Mon, 7 May 2018 17:33:19 +0000 (13:33 -0400)] 
Merge branch 'maint-0.3.3'

7 years agoMerge remote-tracking branch 'mikeperry/bug25733_029' into maint-0.3.3
Nick Mathewson [Mon, 7 May 2018 17:33:12 +0000 (13:33 -0400)] 
Merge remote-tracking branch 'mikeperry/bug25733_029' into maint-0.3.3

7 years agoMerge remote-tracking branch 'saper/default_nickname'
Nick Mathewson [Mon, 7 May 2018 17:31:03 +0000 (13:31 -0400)] 
Merge remote-tracking branch 'saper/default_nickname'

7 years agoMerge branch 'ticket26014'
Nick Mathewson [Mon, 7 May 2018 16:07:53 +0000 (12:07 -0400)] 
Merge branch 'ticket26014'

7 years agoMerge remote-tracking branch 'mikeperry/bug25705_v3_033'
Nick Mathewson [Mon, 7 May 2018 15:09:25 +0000 (11:09 -0400)] 
Merge remote-tracking branch 'mikeperry/bug25705_v3_033'

7 years agoFix the selection of events to cancel in test_workqueue.c
Nick Mathewson [Mon, 7 May 2018 01:03:26 +0000 (21:03 -0400)] 
Fix the selection of events to cancel in test_workqueue.c

Our previous algorithm had a nonzero probability of picking no
events to cancel, which is of course incorrect.  The new code uses
Vitter's good old reservoir sampling "algorithm R" from 1985.

Fixes bug 26008; bugfix on 0.2.6.3-alpha.

7 years agoAdd unit test for ..get_start_of_next_voting_interval().
Nick Mathewson [Mon, 7 May 2018 00:42:18 +0000 (20:42 -0400)] 
Add unit test for ..get_start_of_next_voting_interval().

This functionality was covered only accidentally by our voting-test
code, and as such wasn't actually tested at all.  The tests that
called it made its coverage nondeterministic, depending on what time
of day you ran the tests.

Closes ticket 26014.

7 years agobuild: Fix missing include for src/rust/external/crypto_rand.rs file.
Isis Lovecruft [Fri, 4 May 2018 22:23:17 +0000 (22:23 +0000)] 
build: Fix missing include for src/rust/external/crypto_rand.rs file.

 * FIXES #26025: https://bugs.torproject.org/26025

7 years agorust: Update Cargo.lock file with changes from #26024.
Isis Lovecruft [Fri, 4 May 2018 20:41:25 +0000 (20:41 +0000)] 
rust: Update Cargo.lock file with changes from #26024.

7 years agorust: Update submodule commit for src/ext/rust directory.
Isis Lovecruft [Fri, 4 May 2018 20:37:16 +0000 (20:37 +0000)] 
rust: Update submodule commit for src/ext/rust directory.

 * FIXES part of #26024: https://bugs.torproject.org/26024

7 years agoUpdate rand dependency from 0.5.0-pre.0 to 0.5.0-pre.1.
Isis Lovecruft [Fri, 4 May 2018 19:16:42 +0000 (19:16 +0000)] 
Update rand dependency from 0.5.0-pre.0 to 0.5.0-pre.1.

7 years agoI should have tested before I pushed.
Nick Mathewson [Fri, 4 May 2018 00:16:53 +0000 (20:16 -0400)] 
I should have tested before I pushed.

7 years agoMerge remote-tracking branch 'github/ticket25995'
Nick Mathewson [Thu, 3 May 2018 20:52:09 +0000 (16:52 -0400)] 
Merge remote-tracking branch 'github/ticket25995'

7 years agoMerge remote-tracking branch 'dgoulet/ticket25914_034_01'
Nick Mathewson [Thu, 3 May 2018 20:48:03 +0000 (16:48 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket25914_034_01'

7 years agoAdd src/rust/rand to include.am
Nick Mathewson [Thu, 3 May 2018 20:16:09 +0000 (16:16 -0400)] 
Add src/rust/rand to include.am

7 years agoMove some includes around to try to fix windows builds
Nick Mathewson [Thu, 3 May 2018 20:14:38 +0000 (16:14 -0400)] 
Move some includes around to try to fix windows builds

7 years agoUpdate rust dependencies to latest version.
Nick Mathewson [Thu, 3 May 2018 17:55:55 +0000 (13:55 -0400)] 
Update rust dependencies to latest version.

7 years agoMerge remote-tracking branch 'isis/bug24660_r1'
Nick Mathewson [Thu, 3 May 2018 17:50:18 +0000 (13:50 -0400)] 
Merge remote-tracking branch 'isis/bug24660_r1'

7 years agoMerge remote-tracking branch 'dgoulet/ticket25991_034_01'
Nick Mathewson [Thu, 3 May 2018 17:41:34 +0000 (13:41 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket25991_034_01'

7 years agoMerge remote-tracking branch 'dgoulet/ticket25990_034_01'
Nick Mathewson [Thu, 3 May 2018 17:40:10 +0000 (13:40 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket25990_034_01'

7 years agoMerge branch 'maint-0.3.2' into maint-0.3.3
Nick Mathewson [Thu, 3 May 2018 17:38:54 +0000 (13:38 -0400)] 
Merge branch 'maint-0.3.2' into maint-0.3.3

7 years agoMerge branch 'maint-0.3.3'
Nick Mathewson [Thu, 3 May 2018 17:38:54 +0000 (13:38 -0400)] 
Merge branch 'maint-0.3.3'

7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Thu, 3 May 2018 17:38:54 +0000 (13:38 -0400)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoMerge branch 'maint-0.2.9' into maint-0.3.1
Nick Mathewson [Thu, 3 May 2018 17:38:54 +0000 (13:38 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.1

7 years agoMerge remote-tracking branch 'catalyst-github/bug25936-033' into maint-0.3.3
Nick Mathewson [Thu, 3 May 2018 17:38:51 +0000 (13:38 -0400)] 
Merge remote-tracking branch 'catalyst-github/bug25936-033' into maint-0.3.3

7 years agoMerge remote-tracking branch 'catalyst-github/bug25936-031' into maint-0.3.1
Nick Mathewson [Thu, 3 May 2018 17:38:46 +0000 (13:38 -0400)] 
Merge remote-tracking branch 'catalyst-github/bug25936-031' into maint-0.3.1

7 years agoMerge remote-tracking branch 'catalyst-github/bug25936-029' into maint-0.2.9
Nick Mathewson [Thu, 3 May 2018 17:38:37 +0000 (13:38 -0400)] 
Merge remote-tracking branch 'catalyst-github/bug25936-029' into maint-0.2.9

7 years agoMerge branch 'maint-0.3.3'
Nick Mathewson [Thu, 3 May 2018 17:37:37 +0000 (13:37 -0400)] 
Merge branch 'maint-0.3.3'

7 years agoMerge remote-tracking branch 'teor/bug25998' into maint-0.3.3
Nick Mathewson [Thu, 3 May 2018 17:37:33 +0000 (13:37 -0400)] 
Merge remote-tracking branch 'teor/bug25998' into maint-0.3.3

7 years agoMerge remote-tracking branch 'github/ticket25952'
Nick Mathewson [Thu, 3 May 2018 15:59:53 +0000 (11:59 -0400)] 
Merge remote-tracking branch 'github/ticket25952'

7 years agoMerge remote-tracking branch 'github/ticket25951'
Nick Mathewson [Thu, 3 May 2018 15:59:31 +0000 (11:59 -0400)] 
Merge remote-tracking branch 'github/ticket25951'

7 years agoMerge remote-tracking branch 'github/ticket25949'
Nick Mathewson [Thu, 3 May 2018 15:57:09 +0000 (11:57 -0400)] 
Merge remote-tracking branch 'github/ticket25949'

7 years agodoc: Add missing HACKING/ files to EXTRA_DIST
David Goulet [Wed, 2 May 2018 18:28:40 +0000 (14:28 -0400)] 
doc: Add missing HACKING/ files to EXTRA_DIST

Apart from adding the newly created Module.md, this commit also adds all the
missing files we have in HACKING/ to the EXTRA_DIST.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodoc: Add Module.md explaining Tor modules
David Goulet [Wed, 2 May 2018 18:24:46 +0000 (14:24 -0400)] 
doc: Add Module.md explaining Tor modules

Initial document that contains guidelines to write a new module in Tor.

Closes #25991

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agohs-v3: Remove extra white-space and clarify comment
David Goulet [Thu, 3 May 2018 13:34:50 +0000 (09:34 -0400)] 
hs-v3: Remove extra white-space and clarify comment

From Neel's latest patch on optimizing the hs_circ_service_get_intro_circ()
digest calculation, remove an extra white-space and clarify a comment of the
legacy key digest to inform when to use it.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge remote-tracking branch 'asn/bug23107'
David Goulet [Thu, 3 May 2018 13:33:42 +0000 (09:33 -0400)] 
Merge remote-tracking branch 'asn/bug23107'

7 years agorust: Expose crypto_rand() as an impl of rand_core::RngCore.
Isis Lovecruft [Wed, 2 May 2018 22:12:38 +0000 (22:12 +0000)] 
rust: Expose crypto_rand() as an impl of rand_core::RngCore.

7 years agoMerge branch 'ticket25997'
Nick Mathewson [Wed, 2 May 2018 20:03:57 +0000 (16:03 -0400)] 
Merge branch 'ticket25997'

7 years agodirauth: Move authdir_mode_v3() to module
David Goulet [Wed, 2 May 2018 17:42:24 +0000 (13:42 -0400)] 
dirauth: Move authdir_mode_v3() to module

This function must return false if the module is not compiled in. In order to
do that, we move the authdir_mode_v3() function out of router.c and into the
dirauth module new header file named mode.h.

It is always returning false if we don't have the module.

Closes #25990

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMake hs_get_responsible_hsdirs() deterministic.
Nick Mathewson [Wed, 2 May 2018 14:16:23 +0000 (10:16 -0400)] 
Make hs_get_responsible_hsdirs() deterministic.

This test was using the current time to pick the time period number,
and a randomly generated hs key.  Therefore, it sometimes picked an
index that would wrap around the example dht, and sometimes would
not.

The fix here is just to fix the time period and the public key.

Fixes bug 25997; bugfix on 0.3.2.1-alpha.

7 years agodirvote: Fix typo in comment
David Goulet [Wed, 2 May 2018 13:06:40 +0000 (09:06 -0400)] 
dirvote: Fix typo in comment

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge branch 'maint-0.3.1' into maint-0.3.2
Nick Mathewson [Wed, 2 May 2018 12:46:28 +0000 (08:46 -0400)] 
Merge branch 'maint-0.3.1' into maint-0.3.2

7 years agoMerge branch 'maint-0.2.9' into maint-0.3.1
Nick Mathewson [Wed, 2 May 2018 12:46:28 +0000 (08:46 -0400)] 
Merge branch 'maint-0.2.9' into maint-0.3.1

7 years agoMerge branch 'maint-0.3.2' into maint-0.3.3
Nick Mathewson [Wed, 2 May 2018 12:46:28 +0000 (08:46 -0400)] 
Merge branch 'maint-0.3.2' into maint-0.3.3

7 years agoMerge branch 'maint-0.3.3'
Nick Mathewson [Wed, 2 May 2018 12:46:28 +0000 (08:46 -0400)] 
Merge branch 'maint-0.3.3'

7 years agoMerge branch 'ticket25996'
Nick Mathewson [Wed, 2 May 2018 12:45:35 +0000 (08:45 -0400)] 
Merge branch 'ticket25996'

7 years agoStop logging stack contents when reading a zero-length bandwidth file
teor [Wed, 2 May 2018 12:33:21 +0000 (22:33 +1000)] 
Stop logging stack contents when reading a zero-length bandwidth file

When directory authorities read a zero-byte bandwidth file, they log
a warning with the contents of an uninitialised buffer. Log a warning
about the empty file instead.

Fixes bug 26007; bugfix on 0.2.2.1-alpha.

7 years agoBug 26000: Fix missing ";"
Georg Koppen [Wed, 2 May 2018 06:20:26 +0000 (06:20 +0000)] 
Bug 26000: Fix missing ";"

7 years agosquash! Optimize legacy intro point digest calculation.
George Kadianakis [Wed, 2 May 2018 11:09:15 +0000 (14:09 +0300)] 
squash! Optimize legacy intro point digest calculation.

7 years agoOptimize legacy intro point digest calculation.
Neel Chauhan [Fri, 27 Apr 2018 21:45:16 +0000 (17:45 -0400)] 
Optimize legacy intro point digest calculation.

7 years agoman page: FetchUselessDescriptors and DirCache exclude extra infos
teor [Wed, 2 May 2018 01:29:48 +0000 (11:29 +1000)] 
man page: FetchUselessDescriptors and DirCache exclude extra infos

7 years agoman page: UseMicrodescriptors auto and 1 are the same now
teor [Wed, 2 May 2018 00:46:10 +0000 (10:46 +1000)] 
man page: UseMicrodescriptors auto and 1 are the same now

7 years agoman page: FetchUselessDescriptors stops tor going idle
teor [Wed, 2 May 2018 00:46:00 +0000 (10:46 +1000)] 
man page: FetchUselessDescriptors stops tor going idle

Also explain how FetchUselessDescriptors and UseMicrodescriptors are
different.

Closes 25998.

7 years agocoverage: Repeat the test for avoiding failed intro points
Nick Mathewson [Tue, 1 May 2018 23:58:39 +0000 (19:58 -0400)] 
coverage: Repeat the test for avoiding failed intro points

This test, in test_client_pick_intro(), will have different coverage
depending on whether it selects a good intro point the first time or
whether it has to try a few times.  Since it produces the shorter
coverage with P=1/4, repeat this test 64 times so that it only
provides reduced coverage with P=1/2^128.  The performance cost is
negligible.

Closes ticket 25996.  This test was introduced in 0.3.2.1-alpha.

7 years agoUse a deterministic PRNG in test_circuit_timeout()
Nick Mathewson [Tue, 1 May 2018 23:34:21 +0000 (19:34 -0400)] 
Use a deterministic PRNG in test_circuit_timeout()

I'd prefer not to do this for randomized tests, but as things stand
with this test, it produces nondeterministic test coverage.

Closes ticket 25995; bugfix on 0.2.2.2-alpha when this test was
introduced.

7 years agoStop using approx_time() in circuitmux_ewma.
Nick Mathewson [Tue, 1 May 2018 22:28:01 +0000 (18:28 -0400)] 
Stop using approx_time() in circuitmux_ewma.

It doesn't match with the tick-count code any longer.

Bug not in any released Tor.

7 years agoBug 25705: Don't count circuit path failures as build failures.
Mike Perry [Sun, 1 Apr 2018 03:52:34 +0000 (03:52 +0000)] 
Bug 25705: Don't count circuit path failures as build failures.

Also emit a rate limited log message when they happen, since they are likely
correlated with other issues.

7 years agoMerge remote-tracking branch 'github/eliminate_gettimeofday_cached'
Nick Mathewson [Tue, 1 May 2018 17:27:02 +0000 (13:27 -0400)] 
Merge remote-tracking branch 'github/eliminate_gettimeofday_cached'

7 years agoMove unreachable port warnings to a periodic event.
Nick Mathewson [Tue, 1 May 2018 17:14:18 +0000 (13:14 -0400)] 
Move unreachable port warnings to a periodic event.

Arguably, the conditions under which these events happen should be a
bit different, but the rules are complex enough here that I've tried
to have this commit be pure refactoring.

Closes ticket 25952.

Finally, before this code goes away, take a moment to look at the
amazing way that we used to try to have an event happen
every N seconds:

      get_uptime() / N != (get_uptime()+seconds_elapsed) / N

Truly, it is a thing of wonder.  I'm glad we didn't start using this
pattern everywhere else.

7 years agoBuild Tor without dirauth module in Travis.
Alexander Færøy [Fri, 27 Apr 2018 17:06:04 +0000 (19:06 +0200)] 
Build Tor without dirauth module in Travis.

See: https://bugs.torproject.org/25953

7 years agoAdd changes file for #25610
David Goulet [Tue, 1 May 2018 15:38:56 +0000 (11:38 -0400)] 
Add changes file for #25610

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodirvote: Make tokens a const in dirvote_parse_sr_commits()
David Goulet [Tue, 1 May 2018 15:35:26 +0000 (11:35 -0400)] 
dirvote: Make tokens a const in dirvote_parse_sr_commits()

Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMake find_opt_by_keyword() take a const smartlist
David Goulet [Tue, 1 May 2018 15:33:40 +0000 (11:33 -0400)] 
Make find_opt_by_keyword() take a const smartlist

Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agosr: Rename shared_random_common.{c|h} to shared_random_client.{c|h}
David Goulet [Tue, 1 May 2018 15:31:33 +0000 (11:31 -0400)] 
sr: Rename shared_random_common.{c|h} to shared_random_client.{c|h}

No code behavior change.

Pars of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agovote: Move dirvote_recalculate_timing() to voting_schedule.c
David Goulet [Tue, 1 May 2018 15:25:25 +0000 (11:25 -0400)] 
vote: Move dirvote_recalculate_timing() to voting_schedule.c

By doing so, it is renamed to voting_schedule_recalculate_timing(). This
required a lot of changes to include voting_schedule.h everywhere that this
function was used.

This effectively now makes voting_schedule.{c|h} not include dirauth/dirvote.h
for that symbol and thus no dependency on the dirauth module anymore.

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agovote: Namespace functions in voting_schedule.c
David Goulet [Tue, 1 May 2018 15:18:44 +0000 (11:18 -0400)] 
vote: Namespace functions in voting_schedule.c

Rename them from dirvote_* to voting_schedule_*.

No code behavior change.

Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoRename dirvote_common.{c|h} to voting_schedule.{c|h}
David Goulet [Tue, 1 May 2018 15:10:58 +0000 (11:10 -0400)] 
Rename dirvote_common.{c|h} to voting_schedule.{c|h}

No code behavior change.

Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agodirvote: Make dirvote_get_preferred_voting_intervals() static
David Goulet [Tue, 1 May 2018 15:04:13 +0000 (11:04 -0400)] 
dirvote: Make dirvote_get_preferred_voting_intervals() static

This function doesn't need to be public from the dirvote common file (which
will get renamed in future commit) so move it to dirauth/dirvote.c and make it
static.

Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agons: Move dirvote_get_voter_sig_by_alg() to networkstatus.c
David Goulet [Tue, 1 May 2018 14:59:10 +0000 (10:59 -0400)] 
ns: Move dirvote_get_voter_sig_by_alg() to networkstatus.c

It makes more sense to be in networkstatus.c so move it there and rename it
with the "networkstatus_" prefix.

Part of #25988

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoMerge branch 'dirvote_act_refactor_v2_squashed'
Nick Mathewson [Tue, 1 May 2018 14:57:04 +0000 (10:57 -0400)] 
Merge branch 'dirvote_act_refactor_v2_squashed'

7 years agoRefactor to use safe_timer_diff.
Nick Mathewson [Tue, 1 May 2018 14:56:11 +0000 (10:56 -0400)] 
Refactor to use safe_timer_diff.

7 years agoReschedule voting callback when any cfg option affecting it changes.
Nick Mathewson [Mon, 30 Apr 2018 14:16:40 +0000 (10:16 -0400)] 
Reschedule voting callback when any cfg option affecting it changes.

7 years agoEnsure that voting is rescheduled whenever the schedule changes.
Nick Mathewson [Fri, 27 Apr 2018 13:55:05 +0000 (09:55 -0400)] 
Ensure that voting is rescheduled whenever the schedule changes.

7 years agoMove responsibility for voting into a separate periodic callback.
Nick Mathewson [Fri, 27 Apr 2018 13:50:07 +0000 (09:50 -0400)] 
Move responsibility for voting into a separate periodic callback.

Closes ticket25937.

7 years agoUpdate dirvote_act() to return the time of its next action.
Nick Mathewson [Thu, 26 Apr 2018 21:42:43 +0000 (17:42 -0400)] 
Update dirvote_act() to return the time of its next action.

This is remarkably simple, given the macros in the last commit.

7 years agoStart refactoring dirvote_act() towards self-scheduling
Nick Mathewson [Thu, 26 Apr 2018 21:37:09 +0000 (17:37 -0400)] 
Start refactoring dirvote_act() towards self-scheduling

This change should have no behavioral effect: it just uses macros to
describe the current control flow.

7 years agoFix an assertion failure introduced by #25948
Nick Mathewson [Tue, 1 May 2018 14:47:44 +0000 (10:47 -0400)] 
Fix an assertion failure introduced by #25948

Apparently, we can decide our state is dirty before we create the
event to tell the mainloop that we should save it.  That's not a
problem, except for the assertion failure.

7 years agoMerge remote-tracking branch 'ffmancera-1/bug20522'
Nick Mathewson [Tue, 1 May 2018 14:43:40 +0000 (10:43 -0400)] 
Merge remote-tracking branch 'ffmancera-1/bug20522'

7 years agoRemove responsibility for flushing log cbs from mainloop
Nick Mathewson [Tue, 1 May 2018 14:38:46 +0000 (10:38 -0400)] 
Remove responsibility for flushing log cbs from mainloop

This is now handled as-needed as the control module is flushing its
own callbacks.  Closes ticket 25951.

7 years agoMerge remote-tracking branch 'dgoulet/ticket25610_034_01-squashed'
Nick Mathewson [Tue, 1 May 2018 14:29:05 +0000 (10:29 -0400)] 
Merge remote-tracking branch 'dgoulet/ticket25610_034_01-squashed'

7 years agoGive queued_events_flush_all() responsibility for flushing log cbs
Nick Mathewson [Tue, 1 May 2018 14:26:04 +0000 (10:26 -0400)] 
Give queued_events_flush_all() responsibility for flushing log cbs

This requires that when a log cb happens, the event for flushing
queued events is scheduled, so we also add the necessary machinery
to have that happen.

Note that this doesn't actually help with logs from outside the main
thread, but those were already suppressed: see #25987 for a ticket
tracking that issue.

7 years agoAdd a mechanism for the logging system to report queued callbacks
Nick Mathewson [Tue, 1 May 2018 14:05:22 +0000 (10:05 -0400)] 
Add a mechanism for the logging system to report queued callbacks

Sometimes the logging system will queue a log message for later.
When it does this, the callback will either get flushed at the next
safe time, or from the second-elapsed callback.

But we're trying to eliminate the second-elapsed callback, so let's
make a way for the log system to tell its users about this.