David Goulet [Wed, 21 Jan 2015 18:18:56 +0000 (13:18 -0500)]
Support monotonic time for pthread_cond_timedwait
This is to avoid that the pthread_cond_timedwait() is not affected by time
adjustment which could make the waiting period very long or very short which
is not what we want in any cases.
Nick Mathewson [Wed, 14 Jan 2015 18:29:58 +0000 (13:29 -0500)]
Update workqueue implementation to use a single queue for the work
Previously I used one queue per worker; now I use one queue for
everyone. The "broadcast" code is gone, replaced with an idempotent
'update' operation.
Nick Mathewson [Wed, 2 Oct 2013 19:11:34 +0000 (15:11 -0400)]
Avoid chan/circ linear lookups for requests
The solution I took is to not free a circuit with a pending
uncancellable work item, but rather to set its magic number to a
sentinel value. When we get a work item, we check whether the circuit
has that magic sentinel, and if so, we free it rather than processing
the reply.
Nick Mathewson [Wed, 2 Oct 2013 16:34:08 +0000 (12:34 -0400)]
Remove if (1) indentation in cpuworker.c
To avoid having diffs turn out too big, I had replaced some unneeded
ifs and fors with if (1), so that the indentation would still work out
right. Now I might as well clean those up.
Nick Mathewson [Wed, 25 Sep 2013 00:43:48 +0000 (20:43 -0400)]
Isolate the "socketpair or a pipe" logic for alerting main thread
This way we can use the linux eventfd extension where available.
Using EVFILT_USER on the BSDs will be a teeny bit trickier, and will
require libevent hacking.
src/common/compat_libevent.h: include testsupport.h
When tor is configured with --enable-bufferevents, the build fails
because compat_libevent.h makes use of the macro MOCK_DECL() which
is defined in testsupport.h, but not included. We add the include.
Tomasz Torcz [Fri, 9 Jan 2015 22:42:16 +0000 (23:42 +0100)]
fix and enable systemd watchdog
There were following problems:
- configure.ac wrongly checked for defined HAVE_SYSTEMD; this
wasn't working, so the watchdog code was not compiled in.
Replace library search with explicit version check
- sd_notify() watchdog call was unsetting NOTIFY_SOCKET from env;
this means only first "watchdog ping" was delivered, each
subsequent one did not have socket to be sent to and systemd
was killing service
- after those fixes, enable Watchdog in systemd unit with one
minute intervals
Tomasz Torcz [Fri, 9 Jan 2015 21:44:00 +0000 (22:44 +0100)]
send more details about daemon status to supervisor
If running under systemd, send back information when reloading
configuration and gracefully shutting down. This gives administator
more information about current Tor daemon state.
Tomasz Torcz [Fri, 9 Jan 2015 21:17:50 +0000 (22:17 +0100)]
send PID of the main daemon to supervisor
If running under systemd, notify the supervisor about current PID
of Tor daemon. This makes systemd unit simpler and more robust:
it will do the right thing regardless of RunAsDaemon settings.
teor [Sun, 11 Jan 2015 08:33:04 +0000 (19:33 +1100)]
Don't crash on torrc Vi[rtualAddrNetworkIPv[4|6]] with no option value
Check for a missing option value in parse_virtual_addr_network
before asserting on the NULL in tor_addr_parse_mask_ports.
This avoids crashing on torrc lines like Vi[rtualAddrNetworkIPv[4|6]]
when no value follows the option.
Bugfix on 0.2.3 (de4cc126cbb5 on 24 November 2012), fixes #14142.
Nick Mathewson [Sat, 10 Jan 2015 22:21:11 +0000 (17:21 -0500)]
Better workaround for CFLAGS issues from #14072; fixes #14162
When I applied patch fcc78e5f8a3249eadfea31db, I somehow broke
stack trace symbols on Linux. I'll leave it to others to figure out
why that happens. This should be better. Really.
Fixes bug 14162; bug not in any released version of Tor.
teor [Sat, 10 Jan 2015 10:43:31 +0000 (21:43 +1100)]
Create TestingDirAuthVoteHSDir like TestingDirAuthVoteExit/Guard
TestingDirAuthVoteHSDir ensures that authorities vote the HSDir flag
for the listed relays regardless of uptime or ORPort connectivity.
Respects the value of VoteOnHidServDirectoriesV2.
teor [Sat, 10 Jan 2015 06:14:29 +0000 (17:14 +1100)]
Test that tor correctly handles zero-length keys
Check that tor generates new keys, and overwrites the empty key files.
Test that tor generates new keys when keys are missing (existing
behaviour).
Test that tor does not overwrite key files that already contain data
(existing behaviour).
Nick Mathewson [Fri, 19 Jul 2013 03:45:40 +0000 (23:45 -0400)]
Stop accepting milliseconds in various directory contexts
Have clients and authorities both have new behavior, since the
fix for bug 11243 has gone in. But make clients still accept
accept old bogus HSDir descriptors, to avoid fingerprinting trickery.