aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-12-17Add process_terminate().Alexander Færøy
This patch adds support for process termination to the Process subsystem. See: https://bugs.torproject.org/28179
2018-12-17Make sure we call process_notify_event_exit() as the last thing in different ↵Alexander Færøy
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
2018-12-17Add documentation for the is_socket and error argument of read_to_chunk().Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Add process_get_pid() to the Process subsystem.Alexander Færøy
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
2018-12-17Add Windows backend for the Process subsystem.Alexander Færøy
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
2018-12-17Add Unix backend for the Process subsystem.Alexander Færøy
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
2018-12-17Add new Process subsystem.Alexander Færøy
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
2018-11-27Add LD_PROCESS as log domain.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-27Add buf_flush_to_pipe() and buf_read_from_pipe().Alexander Færøy
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
2018-11-27Refactor buf_read_from_socket() into buf_read_from_fd().Alexander Færøy
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
2018-11-27Refactor buf_flush_to_socket() into buf_flush_to_fd().Alexander Færøy
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
2018-11-27Refactor flush_chunk() to work on pipes as well as sockets.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-27Refactor read_to_chunk() such that it supports both pipes and sockets.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-27Remove unused `int pid` member of `managed_proxy_t`.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-11-27Merge branch 'maint-0.3.5'Nick Mathewson
2018-11-27Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2018-11-27Explicitly specify path to OpenSSL for Appveyor.Alexander Færøy
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
2018-11-26Merge branch 'maint-0.3.5'Nick Mathewson
2018-11-26Merge remote-tracking branch 'teor/bug28096-035-squashed' into maint-0.3.5Nick Mathewson
2018-11-26Merge remote-tracking branch 'tor-github/pr/539'Nick Mathewson
2018-11-26Merge remote-tracking branch 'tor-github/pr/495'Nick Mathewson
2018-11-26Changes file for "Dormant Mode" (28335, 2149).Nick Mathewson
2018-11-26Merge branch 'dormant_v2_squashed'Nick Mathewson
2018-11-26Test for check_network_participation_callback()Nick Mathewson
2018-11-26Test netstatus.c tracking of user participation statusNick Mathewson
2018-11-26Add options to control dormant-client feature.Nick Mathewson
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.
2018-11-26Merge branch 'maint-0.3.5'David Goulet
2018-11-26Merge remote-tracking branch 'dgoulet/ticket28128_035_01' into maint-0.3.5David Goulet
2018-11-23Create a temporary directory for tor's DataDirectory in test_rebind.Taylor R Campbell
Fixes #28562. While here, put the argument count test and usage message _before_ we attempt to read from sys.argv.
2018-11-22Fix a comment typo in test_hs_common.cteor
2018-11-21Fix a fun heisenbug in memoize_protover_flags()Nick Mathewson
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.
2018-11-20Merge branch 'ticket25341_merged_v2'Nick Mathewson
2018-11-20Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2018-11-20Merge branch 'maint-0.3.5'Nick Mathewson
2018-11-20Merge remote-tracking branch 'teor/ticket28459-034' into maint-0.3.4Nick Mathewson
2018-11-20Merge branch 'maint-0.3.5'Nick Mathewson
2018-11-19Update control_free_all() for #27169Taylor Yu
Reset the added bootstrap tracking state introduced by ticket 27169. Fixes bug 28524; bugfix on 0.3.5.1-alpha.
2018-11-19Merge branch 'maint-0.3.5'Nick Mathewson
2018-11-19Add missing library to build tor-print-ed-signing-cert.Alexander Færøy
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
2018-11-19Merge remote-tracking branch 'isis/bug25341' into ticket25341_merged_v2Nick Mathewson
2018-11-19Merge remote-tracking branch 'tor-github/pr/519'Nick Mathewson
2018-11-19Merge remote-tracking branch 'tor-github/pr/518'Nick Mathewson
2018-11-19Merge branch 'ticket27359_v2_squashed'Nick Mathewson
2018-11-19Test new functions in nodelist.cNick Mathewson
2018-11-19Expose more nodelist.c functions to testsNick Mathewson
2018-11-19Aim for 100% test coverage on nodefamily.cNick Mathewson
2018-11-19Use nodefamily_t in microdescriptors.Nick Mathewson
Closes ticket 27359.
2018-11-19Backend for compact node-family representation.Nick Mathewson
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.
2018-11-17fixup! Make ROUTERLIST_PRUNING_INTERVAL 1 hr.rl1987
2018-11-17Make ROUTERLIST_PRUNING_INTERVAL 1 hr.rl1987