]> git.ipfire.org Git - thirdparty/tor.git/log
thirdparty/tor.git
6 years agoUse process_t for managed proxies.
Alexander Færøy [Fri, 23 Nov 2018 04:56:41 +0000 (05:56 +0100)] 
Use process_t for managed proxies.

This patch makes the managed proxy subsystem use the process_t data
structure such that we can get events from the PT process while Tor is
running and not just when the PT process is being configured.

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

6 years agoAdd "PT" log domain.
Alexander Færøy [Thu, 22 Nov 2018 18:00:21 +0000 (19:00 +0100)] 
Add "PT" log domain.

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

6 years agoAdd process_reset_environment() to the Process subsystem.
Alexander Færøy [Fri, 23 Nov 2018 04:43:34 +0000 (05:43 +0100)] 
Add process_reset_environment() to the Process subsystem.

This patch adds a new function that allows us to reset the environment
of a given process_t with a list of key/value pairs.

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

6 years agoAdd process_terminate().
Alexander Færøy [Fri, 23 Nov 2018 02:44:59 +0000 (03:44 +0100)] 
Add process_terminate().

This patch adds support for process termination to the Process
subsystem.

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

6 years agoMake sure we call process_notify_event_exit() as the last thing in different callbacks.
Alexander Færøy [Thu, 22 Nov 2018 17:14:03 +0000 (18:14 +0100)] 
Make sure we call process_notify_event_exit() as the last thing in different callbacks.

This patch makes sure that we call process_notify_event_exit() after we
have done any modifications we need to do to the state of a process_t.
This allows application developers to call process_free() in the
exit_callback of the process.

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

6 years agoAdd documentation for the is_socket and error argument of read_to_chunk().
Alexander Færøy [Thu, 22 Nov 2018 16:38:40 +0000 (17:38 +0100)] 
Add documentation for the is_socket and error argument of read_to_chunk().

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

6 years agoAdd process_get_pid() to the Process subsystem.
Alexander Færøy [Thu, 22 Nov 2018 04:22:24 +0000 (05:22 +0100)] 
Add process_get_pid() to the Process subsystem.

This patch adds support for getting the unique process identifier from a
given process_t. This patch implements both support for both the Unix
and Microsoft Windows backend.

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

6 years agoAdd Windows backend for the Process subsystem.
Alexander Færøy [Thu, 22 Nov 2018 03:49:23 +0000 (04:49 +0100)] 
Add Windows backend for the Process subsystem.

This patch adds support for Microsoft Windows in the Process subsystem.

Libevent does not support mixing different types of handles (sockets,
named pipes, etc.) on Windows in its core event loop code. This have
historically meant that Tor have avoided attaching any non-networking
handles to the event loop. This patch uses a slightly different approach
to roughly support the same features for the Process subsystem as we do
with the Unix backend.

In this patch we use Windows Extended I/O functions (ReadFileEx() and
WriteFileEx()) which executes asynchronously in the background and
executes a completion routine when the scheduled read or write operation
have completed. This is much different from the Unix backend where the
operating system signals to us whenever a file descriptor is "ready" to
either being read from or written to.

To make the Windows operating system execute the completion routines of
ReadFileEx() and WriteFileEx() we must get the Tor process into what
Microsoft calls an "alertable" state. To do this we execute SleepEx()
with a zero millisecond sleep time from a main loop timer that ticks
once a second.  This moves the process into the "alertable" state and
when we return from the zero millisecond timeout all the outstanding I/O
completion routines will be called and we can schedule the next reads
and writes.

The timer loop is also responsible for detecting whether our child
processes have terminated since the last timer tick.

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

6 years agoAdd Unix backend for the Process subsystem.
Alexander Færøy [Thu, 22 Nov 2018 03:43:27 +0000 (04:43 +0100)] 
Add Unix backend for the Process subsystem.

This patch adds the Unix backend for the Process subsystem. The Unix
backend attaches file descriptors from the child process's standard in,
out and error to Tor's libevent based main loop using traditional Unix
pipes. We use the already available `waitpid` module to get events
whenever the child process terminates.

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

6 years agoAdd new Process subsystem.
Alexander Færøy [Thu, 22 Nov 2018 03:25:11 +0000 (04:25 +0100)] 
Add new Process subsystem.

This patch adds a new Process subsystem for running external programs in
the background of Tor. The design is focused around a new type named
`process_t` which have an API that allows the developer to easily write
code that interacts with the given child process. These interactions
includes:

- Easy API for writing output to the child process's standard input
  handle.
- Receive callbacks whenever the child has output on either its standard
  output or standard error handles.
- Receive callback when the child process terminates.

We also support two different "protocols" for handling output from the
child process. The default protocol is the "line" protocol where the
process output callbacks will be invoked only when there is complete
lines (either "\r\n" or "\n" terminated). We also support the "raw"
protocol where the read callbacks will get whatever the operating system
delivered to us in a single read operation.

This patch does not include any operating system backends, but the Unix
and Windows backends will be included in separate commits.

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

7 years agoAdd LD_PROCESS as log domain.
Alexander Færøy [Mon, 10 Sep 2018 13:15:45 +0000 (15:15 +0200)] 
Add LD_PROCESS as log domain.

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

7 years agoAdd buf_flush_to_pipe() and buf_read_from_pipe().
Alexander Færøy [Mon, 10 Sep 2018 12:42:29 +0000 (14:42 +0200)] 
Add buf_flush_to_pipe() and buf_read_from_pipe().

This patch adds two new functions: buf_flush_to_pipe() and
buf_read_from_pipe(), which makes use of our new buf_flush_to_fd() and
buf_read_from_fd() functions.

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

7 years agoRefactor buf_read_from_socket() into buf_read_from_fd().
Alexander Færøy [Mon, 10 Sep 2018 12:35:38 +0000 (14:35 +0200)] 
Refactor buf_read_from_socket() into buf_read_from_fd().

This patch refactors buf_read_from_socket() into buf_read_from_fd(), and
creates a specialized function for buf_read_from_socket(), which uses
buf_read_from_fd().

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

7 years agoRefactor buf_flush_to_socket() into buf_flush_to_fd().
Alexander Færøy [Mon, 10 Sep 2018 12:29:27 +0000 (14:29 +0200)] 
Refactor buf_flush_to_socket() into buf_flush_to_fd().

This patch refactors buf_flush_to_socket() into buf_flush_to_fd() and
creates a specialization function for buf_flush_to_socket() that makes
use of buf_flush_to_fd().

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

7 years agoRefactor flush_chunk() to work on pipes as well as sockets.
Alexander Færøy [Mon, 10 Sep 2018 11:28:01 +0000 (13:28 +0200)] 
Refactor flush_chunk() to work on pipes as well as sockets.

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

7 years agoRefactor read_to_chunk() such that it supports both pipes and sockets.
Alexander Færøy [Mon, 10 Sep 2018 11:23:59 +0000 (13:23 +0200)] 
Refactor read_to_chunk() such that it supports both pipes and sockets.

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

7 years agoRemove unused `int pid` member of `managed_proxy_t`.
Alexander Færøy [Mon, 10 Sep 2018 11:05:01 +0000 (13:05 +0200)] 
Remove unused `int pid` member of `managed_proxy_t`.

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

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Tue, 27 Nov 2018 17:03:50 +0000 (12:03 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
Nick Mathewson [Tue, 27 Nov 2018 17:03:50 +0000 (12:03 -0500)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

7 years agoExplicitly specify path to OpenSSL for Appveyor.
Alexander Færøy [Tue, 27 Nov 2018 01:35:44 +0000 (02:35 +0100)] 
Explicitly specify path to OpenSSL for Appveyor.

This patch explicitly specifies the path to our OpenSSL dependency and
disables the installation of an external OpenSSL version and instead
uses the OpenSSL version available from the MinGW environments.

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

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Mon, 26 Nov 2018 22:25:28 +0000 (17:25 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge remote-tracking branch 'teor/bug28096-035-squashed' into maint-0.3.5
Nick Mathewson [Mon, 26 Nov 2018 22:24:41 +0000 (17:24 -0500)] 
Merge remote-tracking branch 'teor/bug28096-035-squashed' into maint-0.3.5

7 years agoMerge remote-tracking branch 'tor-github/pr/539'
Nick Mathewson [Mon, 26 Nov 2018 22:22:37 +0000 (17:22 -0500)] 
Merge remote-tracking branch 'tor-github/pr/539'

7 years agoMerge remote-tracking branch 'tor-github/pr/495'
Nick Mathewson [Mon, 26 Nov 2018 22:17:40 +0000 (17:17 -0500)] 
Merge remote-tracking branch 'tor-github/pr/495'

7 years agoChanges file for "Dormant Mode" (28335, 2149).
Nick Mathewson [Mon, 26 Nov 2018 21:39:44 +0000 (16:39 -0500)] 
Changes file for "Dormant Mode" (28335, 2149).

7 years agoMerge branch 'dormant_v2_squashed'
Nick Mathewson [Mon, 26 Nov 2018 21:33:31 +0000 (16:33 -0500)] 
Merge branch 'dormant_v2_squashed'

7 years agoTest for check_network_participation_callback()
Nick Mathewson [Mon, 19 Nov 2018 21:31:50 +0000 (16:31 -0500)] 
Test for check_network_participation_callback()

7 years agoTest netstatus.c tracking of user participation status
Nick Mathewson [Mon, 19 Nov 2018 20:35:55 +0000 (15:35 -0500)] 
Test netstatus.c tracking of user participation status

7 years agoAdd options to control dormant-client feature.
Nick Mathewson [Thu, 15 Nov 2018 18:16:58 +0000 (13:16 -0500)] 
Add options to control dormant-client feature.

The DormantClientTimeout option controls how long Tor will wait before
going dormant.  It also provides a way to disable the feature by setting
DormantClientTimeout to e.g. "50 years".

The DormantTimeoutDisabledByIdleStreams option controls whether open but
inactive streams count as "client activity".  To implement it, I had to
make it so that reading or writing on a client stream *always* counts as
activity.

Closes ticket 28429.

7 years agoMerge branch 'maint-0.3.5'
David Goulet [Mon, 26 Nov 2018 19:59:24 +0000 (14:59 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge remote-tracking branch 'dgoulet/ticket28128_035_01' into maint-0.3.5
David Goulet [Mon, 26 Nov 2018 19:59:10 +0000 (14:59 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket28128_035_01' into maint-0.3.5

7 years agoCreate a temporary directory for tor's DataDirectory in test_rebind.
Taylor R Campbell [Thu, 22 Nov 2018 00:53:57 +0000 (00:53 +0000)] 
Create a temporary directory for tor's DataDirectory in test_rebind.

Fixes #28562.

While here, put the argument count test and usage message _before_ we
attempt to read from sys.argv.

7 years agoFix a comment typo in test_hs_common.c
teor [Wed, 21 Nov 2018 10:15:21 +0000 (20:15 +1000)] 
Fix a comment typo in test_hs_common.c

7 years agoFix a fun heisenbug in memoize_protover_flags()
Nick Mathewson [Wed, 21 Nov 2018 12:38:38 +0000 (07:38 -0500)] 
Fix a fun heisenbug in memoize_protover_flags()

After we clear the protover map for getting full, we need to
re-create it, since we are about to use it.

This is a bugfix for bug 28558. It is a bugfix for the code from
ticket 27225, which is not in any released Tor.  Found by Google
OSS-Fuzz, as issue 11475.

7 years agoMerge branch 'ticket25341_merged_v2'
Nick Mathewson [Tue, 20 Nov 2018 18:14:56 +0000 (13:14 -0500)] 
Merge branch 'ticket25341_merged_v2'

7 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
Nick Mathewson [Tue, 20 Nov 2018 18:10:38 +0000 (13:10 -0500)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Tue, 20 Nov 2018 18:10:38 +0000 (13:10 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge remote-tracking branch 'teor/ticket28459-034' into maint-0.3.4
Nick Mathewson [Tue, 20 Nov 2018 18:10:18 +0000 (13:10 -0500)] 
Merge remote-tracking branch 'teor/ticket28459-034' into maint-0.3.4

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Tue, 20 Nov 2018 14:04:35 +0000 (09:04 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoUpdate control_free_all() for #27169
Taylor Yu [Mon, 19 Nov 2018 21:48:08 +0000 (15:48 -0600)] 
Update control_free_all() for #27169

Reset the added bootstrap tracking state introduced by ticket 27169.
Fixes bug 28524; bugfix on 0.3.5.1-alpha.

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Mon, 19 Nov 2018 15:18:57 +0000 (10:18 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoAdd missing library to build tor-print-ed-signing-cert.
Alexander Færøy [Sat, 17 Nov 2018 02:29:04 +0000 (03:29 +0100)] 
Add missing library to build tor-print-ed-signing-cert.

To succesful compile tor-print-ed-signing-cert.exe on Windows we
sometimes need to include the @TOR_LIB_GDI@ library.

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

7 years agoMerge remote-tracking branch 'isis/bug25341' into ticket25341_merged_v2
Nick Mathewson [Mon, 19 Nov 2018 14:22:30 +0000 (09:22 -0500)] 
Merge remote-tracking branch 'isis/bug25341' into ticket25341_merged_v2

7 years agoMerge remote-tracking branch 'tor-github/pr/519'
Nick Mathewson [Mon, 19 Nov 2018 13:47:03 +0000 (08:47 -0500)] 
Merge remote-tracking branch 'tor-github/pr/519'

7 years agoMerge remote-tracking branch 'tor-github/pr/518'
Nick Mathewson [Mon, 19 Nov 2018 13:45:41 +0000 (08:45 -0500)] 
Merge remote-tracking branch 'tor-github/pr/518'

7 years agoMerge branch 'ticket27359_v2_squashed'
Nick Mathewson [Mon, 19 Nov 2018 13:26:49 +0000 (08:26 -0500)] 
Merge branch 'ticket27359_v2_squashed'

7 years agoTest new functions in nodelist.c
Nick Mathewson [Sat, 17 Nov 2018 18:35:52 +0000 (13:35 -0500)] 
Test new functions in nodelist.c

7 years agoExpose more nodelist.c functions to tests
Nick Mathewson [Sat, 17 Nov 2018 17:55:23 +0000 (12:55 -0500)] 
Expose more nodelist.c functions to tests

7 years agoAim for 100% test coverage on nodefamily.c
Nick Mathewson [Sat, 17 Nov 2018 17:46:59 +0000 (12:46 -0500)] 
Aim for 100% test coverage on nodefamily.c

7 years agoUse nodefamily_t in microdescriptors.
Nick Mathewson [Tue, 23 Oct 2018 23:55:12 +0000 (19:55 -0400)] 
Use nodefamily_t in microdescriptors.

Closes ticket 27359.

7 years agoBackend for compact node-family representation.
Nick Mathewson [Tue, 28 Aug 2018 15:34:31 +0000 (11:34 -0400)] 
Backend for compact node-family representation.

This representation is meant to save memory in microdescriptors --
we can't use it in routerinfo_t yet, since those families need to be
encoded losslessly for directory voting to work.

This representation saves memory in three ways:
   1. It uses only one allocation per family.  (The old way used a
      smartlist (2 allocs) plus one strdup per entry.)
   2. It stores identity digests in binary, not hex.
   3. It keeps families in a canonical format, memoizes, and
      reference-counts them.

Part of #27359.

7 years agofixup! Make ROUTERLIST_PRUNING_INTERVAL 1 hr.
rl1987 [Sat, 17 Nov 2018 08:27:10 +0000 (10:27 +0200)] 
fixup! Make ROUTERLIST_PRUNING_INTERVAL 1 hr.

7 years agoMake ROUTERLIST_PRUNING_INTERVAL 1 hr.
rl1987 [Sat, 17 Nov 2018 08:19:25 +0000 (10:19 +0200)] 
Make ROUTERLIST_PRUNING_INTERVAL 1 hr.

7 years agoCopy 0.3.5.5-alpha changelog into master
Nick Mathewson [Fri, 16 Nov 2018 16:32:52 +0000 (11:32 -0500)] 
Copy 0.3.5.5-alpha changelog into master

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Fri, 16 Nov 2018 16:32:10 +0000 (11:32 -0500)] 
Merge branch 'maint-0.3.5'

"ours" to avoid version bump.

7 years agoBump to 0.3.5.5-alpha-dev
Nick Mathewson [Fri, 16 Nov 2018 16:32:04 +0000 (11:32 -0500)] 
Bump to 0.3.5.5-alpha-dev

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Fri, 16 Nov 2018 13:58:25 +0000 (08:58 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge remote-tracking branch 'dgoulet/ticket27471_035_02' into maint-0.3.5
Nick Mathewson [Fri, 16 Nov 2018 13:57:56 +0000 (08:57 -0500)] 
Merge remote-tracking branch 'dgoulet/ticket27471_035_02' into maint-0.3.5

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Fri, 16 Nov 2018 13:28:59 +0000 (08:28 -0500)] 
Merge branch 'maint-0.3.5'

"ours" to avoid version bump.

7 years agoBump to 0.3.5.5-alpha
Nick Mathewson [Fri, 16 Nov 2018 13:28:45 +0000 (08:28 -0500)] 
Bump to 0.3.5.5-alpha

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Thu, 15 Nov 2018 22:08:34 +0000 (17:08 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
Nick Mathewson [Thu, 15 Nov 2018 22:08:04 +0000 (17:08 -0500)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid taking 25573 and 27686 again.

7 years agoMerge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4
Nick Mathewson [Thu, 15 Nov 2018 22:01:54 +0000 (17:01 -0500)] 
Merge remote-tracking branch 'public/ticket27686_034' into maint-0.3.4

7 years agoMerge branch 'bug25573-034-typefix' into maint-0.3.4
Nick Mathewson [Thu, 15 Nov 2018 21:58:16 +0000 (16:58 -0500)] 
Merge branch 'bug25573-034-typefix' into maint-0.3.4

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Thu, 15 Nov 2018 21:56:11 +0000 (16:56 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
Nick Mathewson [Thu, 15 Nov 2018 21:55:42 +0000 (16:55 -0500)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid duplicating conflict resolution in merge of 24104

7 years agoMerge branch 'maint-0.3.3' into maint-0.3.4
Nick Mathewson [Thu, 15 Nov 2018 21:54:56 +0000 (16:54 -0500)] 
Merge branch 'maint-0.3.3' into maint-0.3.4

7 years agoMerge branch 'maint-0.2.9' into maint-0.3.3
Nick Mathewson [Thu, 15 Nov 2018 21:54:16 +0000 (16:54 -0500)] 
Merge branch 'maint-0.2.9' into maint-0.3.3

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Thu, 15 Nov 2018 21:47:25 +0000 (16:47 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
Nick Mathewson [Thu, 15 Nov 2018 21:47:25 +0000 (16:47 -0500)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

7 years agoMerge branch 'maint-0.3.3' into maint-0.3.4
Nick Mathewson [Thu, 15 Nov 2018 21:47:25 +0000 (16:47 -0500)] 
Merge branch 'maint-0.3.3' into maint-0.3.4

7 years agoMerge branch 'bug26913_033' into maint-0.3.3
Nick Mathewson [Thu, 15 Nov 2018 21:47:22 +0000 (16:47 -0500)] 
Merge branch 'bug26913_033' into maint-0.3.3

7 years agoMerge remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9
Nick Mathewson [Thu, 15 Nov 2018 21:43:50 +0000 (16:43 -0500)] 
Merge remote-tracking branch 'public/bug24104_029_squashed' into maint-0.2.9

Resolved conflicts with the 26269 fix in 015fcd0e1191aa6f.

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Thu, 15 Nov 2018 21:38:32 +0000 (16:38 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge branch 'maint-0.3.4' into maint-0.3.5
Nick Mathewson [Thu, 15 Nov 2018 21:38:19 +0000 (16:38 -0500)] 
Merge branch 'maint-0.3.4' into maint-0.3.5

"ours" merge to avoid the 0.3.3 version of #27550.

7 years agoMerge branch 'maint-0.3.3' into maint-0.3.4
Nick Mathewson [Thu, 15 Nov 2018 21:37:41 +0000 (16:37 -0500)] 
Merge branch 'maint-0.3.3' into maint-0.3.4

7 years agoMerge remote-tracking branch 'dgoulet/bug27550_033_01' into maint-0.3.3
Nick Mathewson [Thu, 15 Nov 2018 21:37:02 +0000 (16:37 -0500)] 
Merge remote-tracking branch 'dgoulet/bug27550_033_01' into maint-0.3.3

7 years agoMerge branch 'maint-0.3.5'
Nick Mathewson [Thu, 15 Nov 2018 21:11:29 +0000 (16:11 -0500)] 
Merge branch 'maint-0.3.5'

7 years agoMerge branch 'bug27740_035_fix' into maint-0.3.5
Nick Mathewson [Thu, 15 Nov 2018 21:11:06 +0000 (16:11 -0500)] 
Merge branch 'bug27740_035_fix' into maint-0.3.5

7 years agoman: ClientOnionAuthDir can't be reloaded with Sandbox 1
David Goulet [Thu, 15 Nov 2018 19:36:39 +0000 (14:36 -0500)] 
man: ClientOnionAuthDir can't be reloaded with Sandbox 1

By adding a file to the ClientOnionAuthDir and sending a HUP signal, tor would
load the new file and use it. However, that doesn't work with the Sandbox
since post initilization, nothing can be changed.

Document in the manpage that limitation within the Sandbox description.

Closes #28128

Signed-off-by: David Goulet <dgoulet@torproject.org>
7 years agoFix shellcheck issues in cov-diff - SC2231, SC2006 and SC2086
rl1987 [Sun, 11 Nov 2018 17:18:49 +0000 (19:18 +0200)] 
Fix shellcheck issues in cov-diff - SC2231, SC2006 and SC2086

7 years agoAdd changes file
rl1987 [Sun, 11 Nov 2018 16:56:20 +0000 (18:56 +0200)] 
Add changes file

7 years agoFix one last SC2086
rl1987 [Sun, 11 Nov 2018 16:04:07 +0000 (18:04 +0200)] 
Fix one last SC2086

7 years agoFix most instances of SC2086 warning
rl1987 [Sun, 11 Nov 2018 15:50:43 +0000 (17:50 +0200)] 
Fix most instances of SC2086 warning

7 years agoFix shellcheck SC2006 warnings in 'coverage' script
rl1987 [Sun, 11 Nov 2018 15:44:41 +0000 (17:44 +0200)] 
Fix shellcheck SC2006 warnings in 'coverage' script

7 years agoMake sure that we are always a net participant when being a server
Nick Mathewson [Wed, 14 Nov 2018 20:05:05 +0000 (15:05 -0500)] 
Make sure that we are always a net participant when being a server

Otherwise, if we're dormant, and we set ORPort, nothing makes us become
non-dormant.

7 years agoRename and fix docs on FLUSH_ON_DISABLE
Nick Mathewson [Wed, 14 Nov 2018 18:42:09 +0000 (13:42 -0500)] 
Rename and fix docs on FLUSH_ON_DISABLE

Also rename "...flush_and_disable()" to "...schedule_and_disable()"

7 years agoReset dormancy status when the clock jumps.
Nick Mathewson [Tue, 13 Nov 2018 20:57:18 +0000 (15:57 -0500)] 
Reset dormancy status when the clock jumps.

7 years agoAdd a periodic event to become dormant.
Nick Mathewson [Tue, 13 Nov 2018 20:51:53 +0000 (15:51 -0500)] 
Add a periodic event to become dormant.

This event makes us become dormant if we have seen no activity in a
long time.

Note that being any kind of a server, or running an onion service,
always counts as being active.

Note that right now, just having an open stream that Tor
did not open on its own (for a directory request) counts as "being
active", so if you have an idle ssh connection, that will keep Tor
from becoming dormant.

Many of the features here should become configurable; I'd like
feedback on which.

7 years agoMake the NET_PARTICIPANT role dependent on user activity
Nick Mathewson [Tue, 13 Nov 2018 20:33:46 +0000 (15:33 -0500)] 
Make the NET_PARTICIPANT role dependent on user activity

This patch implements all of 28337, except for the part where we
turn off the role if we've been idle for a long time.

7 years agowrite_stats_file() is indeed NET_PARTICIPANT; remove comment.
Nick Mathewson [Tue, 13 Nov 2018 15:44:04 +0000 (10:44 -0500)] 
write_stats_file() is indeed NET_PARTICIPANT; remove comment.

7 years agoreset_padding_counts is only once per 24h; it can be all.
Nick Mathewson [Tue, 13 Nov 2018 15:43:08 +0000 (10:43 -0500)] 
reset_padding_counts is only once per 24h; it can be all.

7 years agoTurn second_elapsed_callback into a normal periodic event.
Nick Mathewson [Tue, 13 Nov 2018 14:30:51 +0000 (09:30 -0500)] 
Turn second_elapsed_callback into a normal periodic event.

7 years agoMove the responsibility for delayed shutdown into the mainloop
Nick Mathewson [Tue, 13 Nov 2018 14:04:11 +0000 (09:04 -0500)] 
Move the responsibility for delayed shutdown into the mainloop

This is part of 28422, so we don't have to call
consider_hibernation() once per second when we're dormant.

This commit does not remove delayed shutdown from hibernate.c: it
uses it as a backup shutdown mechanism, in case the regular shutdown
timer mechanism fails for some reason.

7 years agoRemove run_scheduled_events() as a separate function.
Nick Mathewson [Tue, 13 Nov 2018 13:36:38 +0000 (08:36 -0500)] 
Remove run_scheduled_events() as a separate function.

(There was nothing else in second_elapsed_callbck() that couldn't go
here.)

7 years agoMove control_per_second_events() into a callback with its own role
Nick Mathewson [Tue, 13 Nov 2018 13:22:58 +0000 (08:22 -0500)] 
Move control_per_second_events() into a callback with its own role

Part of making extra-dormant mode work; closes ticket 28421.

7 years agoAnnotate 1/s callback elements with NET_PARTICIPANT status.
Nick Mathewson [Tue, 6 Nov 2018 16:14:50 +0000 (11:14 -0500)] 
Annotate 1/s callback elements with NET_PARTICIPANT status.

7 years agoAdd new "ALL" and "NET_PARTICIPANT" roles for periodic events
Nick Mathewson [Tue, 6 Nov 2018 12:27:31 +0000 (07:27 -0500)] 
Add new "ALL" and "NET_PARTICIPANT" roles for periodic events

The previous "ALL" role was the OR of a bunch of other roles,
which is a mistake: it's better if "ALL" means "all".

The "NET_PARTICIPANT" role refers to the anything that is actively
building circuits, downloading directory information, and
participating in the Tor network.  For now, it is set to
!net_is_disabled(), but we're going to use it to implement a new
"extra dormant mode".

Closes ticket 28336.

7 years agoAdd a function to schedule a periodic event once, then disable it
Nick Mathewson [Mon, 5 Nov 2018 21:24:10 +0000 (16:24 -0500)] 
Add a function to schedule a periodic event once, then disable it

7 years agoUse macros to make the periodic event table less verbose.
Nick Mathewson [Mon, 5 Nov 2018 21:09:13 +0000 (16:09 -0500)] 
Use macros to make the periodic event table less verbose.