summaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2019-01-11Include the beginnings of a FAQ about which timer to use.Nick Mathewson
2019-01-09Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-09Merge remote-tracking branch 'tor-github/pr/636' into maint-0.3.5Nick Mathewson
2019-01-09Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-09Fix (and make consistent) the use of OpenBSD preprocessor macro testsKris Katterjohn
Prior to this commit, the testsuite was failing on OpenBSD. After this commit the testsuite runs fine on OpenBSD. It was previously decided to test for the OpenBSD macro (rather than __OpenBSD__, etc.) because OpenBSD forks seem to have the former macro defined. sys/param.h must be included for the OpenBSD macro definition; however, many files tested for the OpenBSD macro without having this header included. This commit includes sys/param.h in the files where the OpenBSD macro is used (and sys/param.h is not already included), and it also changes some instances of the __OpenBSD__ macro to OpenBSD. See commit 27df23abb675ffeb198bf0c1cc85c4baed77a988 which changed everything to use OpenBSD instead of __OpenBSD__ or OPENBSD. See also tickets #6982 and #20980 (the latter ticket is where it was decided to use the OpenBSD macro). Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
2019-01-09Merge branch 'ticket28856_v2'Nick Mathewson
2019-01-07Fix tor_ersatz_socketpair on IPv6-only systemsKris Katterjohn
In get_local_listener used by tor_ersatz_socketpair, the address family used when binding the IPv6 socket was AF_INET instead of AF_INET6. Fixes bug 28995; bugfix on 0.3.5.1-alpha. Signed-off-by: Kris Katterjohn <katterjohn@gmail.com>
2019-01-03Add a #ifdef HAVE_UNISTD_H check to buffers.cNick Mathewson
Reported on tor-dev by Gisle Vanem. Bug not in any released Tor (The suggested patch used _MSC_VER, but that's not how we do stuff with autoconf. With autoconf, you detect the feature you want, rather than trying to list all the systems that do or do not have it.)
2019-01-03Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-03Merge branch 'ticket28851_035_squashed' into maint-0.3.5Nick Mathewson
2019-01-03Stop re-checking our hardcoded dh parameters on every startupNick Mathewson
Closes ticket 28851.
2019-01-03Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-03Merge remote-tracking branch 'public/ticket28838_035' into maint-0.3.5Nick Mathewson
2019-01-03Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-03Merge branch 'maint-0.3.4' into maint-0.3.5Nick Mathewson
2019-01-02Merge branch 'maint-0.3.5'Nick Mathewson
2019-01-02Add an errno.h include to freespace.c to fix bug 28974.Nick Mathewson
2018-12-21Merge branch 'orconn-tracker_squashed'Nick Mathewson
2018-12-21Fix priority on process subsystem level: it uses "net"Nick Mathewson
2018-12-21Merge branch 'ticket28847'Nick Mathewson
2018-12-21Fix typo in time_sys.h.Alexander Færøy
2018-12-21Use the subsystem list to initialize and shutdown process module.Alexander Færøy
This patch makes the process module use the subsystem list for initializing and shutting down. See: https://bugs.torproject.org/28847
2018-12-20Add LD_BTRACK log domain for bootstrap trackerTaylor Yu
Part of ticket 27167.
2018-12-20Merge remote-tracking branch 'tor-github/pr/608'Nick Mathewson
2018-12-20Forward declare smartlist_t in process.hAlexander Færøy
This allows other libraries to include process.h without including the smartlist_t headers first. See: https://bugs.torproject.org/28847
2018-12-20No need to log ordinary EOF conditions as LOG_WARN.Alexander Færøy
Let's not use log_warn() when a pipe is closed under what should be considered normal conditions. See: https://bugs.torproject.org/28179
2018-12-20Make example CancelIoEx() code use CancelIo().Alexander Færøy
This patch changes the CancelIoEx() example code to use CancelIo(), which is available for older versions of Windows too. I still think the kernel handles this nicely by sending broken pipes if either side closes the pipe while I/O operations are pending. See: https://bugs.torproject.org/28179
2018-12-20Handle ERROR_BROKEN_PIPE in completion routines.Alexander Færøy
Handle `ERROR_BROKEN_PIPE` from ReadFileEx() and WriteFileEx() in process_win32_stdin_write_done() and process_win32_handle_read_completion() instead of in the early handler. This most importantmly makes sure that `reached_eof` is set to true when these errors appears. See: https://bugs.torproject.org/28179
2018-12-20Remember to set `reached_eof` when our handles are reporting errors.Alexander Færøy
This patch adds some missing calls to set `reached_eof` of our handles when various error conditions happens or when we close our handle (which happens at `process_terminate()`. See: https://bugs.torproject.org/28179
2018-12-20Handle errors even after success from ReadFileEx() and WriteFileEx().Alexander Færøy
This patch adds some additional error checking after calls to ReadFileEx() and WriteFileEx(). I have not managed to get this code to reach the branch where `error_code` is NOT `ERROR_SUCCESS`, but MSDN says one should check for this condition so we do so just to be safe. See: https://bugs.torproject.org/28179
2018-12-20Delay checking process for termination until both stdout and stderr are closed.Alexander Færøy
This patch makes us delay checking for whether we have an exit code value (via GetExitCodeProcess()) until both stdout and stderr have been closed by the operating system either by the process itself or by process cleanup after termination. See: https://bugs.torproject.org/28179
2018-12-20Remember to close the child process' ends of the pipes.Alexander Færøy
This prevents us from leaking the HANDLE for stdout, stderr, and stdin. See: https://bugs.torproject.org/28179
2018-12-18Merge branch 'ticket28839_v2_squashed'Nick Mathewson
2018-12-18Avoid breaking the event loop prematurely.Alexander Færøy
This patch makes sure that we terminate the event loop from the event loop timer instead of directly in the process' exit handler. This allows us to run the event loop an additional time to ensure that the SleepEx() call on Windows is called and the data from stdout/stderr is delivered to us. Additionally we ensure that we don't try to read or write data from a Unix process that have been terminated in the main loop, since its file descriptors are closed at that time. See: https://bugs.torproject.org/28179
2018-12-17lib/process may include lib/buf.Nick Mathewson
2018-12-17Update location of buffers.hNick Mathewson
2018-12-17Merge branch 'ticket28179_squashed' into ticket28179_squashed_mergedNick Mathewson
2018-12-17Ensure that line_size >= 1 before trying to trim input string.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Make Windows process event timer API available for dormant interface.Alexander Færøy
This patch changes the API of the Windows backend of the Process subsystem to allow the dormant interface to disable the Process event timer. See: https://bugs.torproject.org/28179
2018-12-17Document the format of process_t::arguments.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Use errno directly if we are not reading/writing from/to a socket.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Use `const char *` instead of `char *` for line parameter for process callbacks.Alexander Færøy
This patch changes the type definition of the process callbacks to use `const char *` instead of `char *`. See: https://bugs.torproject.org/28179
2018-12-17Change the Process exit_callback to return bool.Alexander Færøy
This patch changes our process_t's exit_callback to return a boolean value. If the returned value is true, the process subsystem will call process_free() on the given process_t. See: https://bugs.torproject.org/28179
2018-12-17Call close() on stdin/stdout/stderr in process_terminate().Alexander Færøy
Call close() on all process handles after we have called kill(pid, SIGTERM). See: https://bugs.torproject.org/28179
2018-12-17Move remaining code from subprocess.{h,c} to more appropriate places.Alexander Færøy
This patch moves the remaining code from subprocess.{h,c} to more appropriate places in the process.c and process_win32.c module. We also delete the now empty subprocess module files. See: https://bugs.torproject.org/28179
2018-12-17Delete old process_handle_t code.Alexander Færøy
This patch removes the old process_handle_t code. Everything should by now be using the process_t interface. See: https://bugs.torproject.org/28179
2018-12-17Add "PT" log domain.Alexander Færøy
See: https://bugs.torproject.org/28179
2018-12-17Add process_reset_environment() to the Process subsystem.Alexander Færøy
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
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