Nick Mathewson
2c15b65381
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.
2018-11-15 11:17:22 -05:00
Nick Mathewson
ccbb36048f
write_stats_file() is indeed NET_PARTICIPANT; remove comment.
2018-11-15 11:17:22 -05:00
Nick Mathewson
dc21f1f662
reset_padding_counts is only once per 24h; it can be all.
2018-11-15 11:17:22 -05:00
Nick Mathewson
4bf79fa4fa
Turn second_elapsed_callback into a normal periodic event.
2018-11-15 11:17:22 -05:00
Nick Mathewson
303e5c70e0
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.
2018-11-15 11:17:22 -05:00
Nick Mathewson
e535ec8542
Remove run_scheduled_events() as a separate function.
...
(There was nothing else in second_elapsed_callbck() that couldn't go
here.)
2018-11-15 11:17:22 -05:00
Nick Mathewson
a0380b705d
Move control_per_second_events() into a callback with its own role
...
Part of making extra-dormant mode work; closes ticket 28421.
2018-11-15 11:17:22 -05:00
Nick Mathewson
db53bfe8f7
Annotate 1/s callback elements with NET_PARTICIPANT status.
2018-11-15 11:17:22 -05:00
Nick Mathewson
b9a88bd53a
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.
2018-11-15 11:17:22 -05:00
Nick Mathewson
6d84972eb8
Add a function to schedule a periodic event once, then disable it
2018-11-15 11:17:22 -05:00
Nick Mathewson
2070765c7c
Use macros to make the periodic event table less verbose.
2018-11-15 11:17:22 -05:00
Nick Mathewson
f6b8c7da66
Move buffers.c out of lib/containers to resolve a circularity.
2018-11-14 16:07:03 -05:00
Nick Mathewson
12175987fc
Merge branch 'maint-0.3.5'
2018-11-14 15:43:49 -05:00
Nick Mathewson
d598d834f5
Merge branch 'ticket27750_034_01_squashed' into maint-0.3.5
2018-11-14 15:43:46 -05:00
Nick Mathewson
586c3a7c90
Merge branch 'maint-0.3.5'
2018-11-14 07:42:56 -05:00
teor
9daf06d171
comment: circuit_list_path_impl() does not check Named any more
2018-11-14 18:06:14 +10:00
rl1987
100136ca86
Create new periodic event for pruning old info about Tor routers
2018-11-11 20:31:24 +02:00
Nick Mathewson
bf4f55a13d
Merge branch 'subsystems'
2018-11-09 15:01:49 -05:00
Nick Mathewson
c7b6ed1d80
Merge remote-tracking branch 'tor-github/pr/271'
2018-11-07 11:21:13 -05:00
Nick Mathewson
9807da9c20
Merge branch 'ticket27225_squashed'
2018-11-07 10:47:29 -05:00
Nick Mathewson
6d93820499
Memoize summarize_protover_flags()
...
Our tests showed that this function is responsible for a huge number
of our malloc/free() calls. It's a prime candidate for being
memoized.
Closes ticket 27225.
2018-11-07 10:47:07 -05:00
Nick Mathewson
313b5b956c
Merge branch 'maint-0.3.5'
2018-11-06 09:16:25 -05:00
Nick Mathewson
9431d35074
Merge branch 'bug28348_034' into bug28348_035
2018-11-06 07:42:55 -05:00
Nick Mathewson
7bb76b24cf
Code to manage the list of subsystems.
2018-11-05 09:22:02 -05:00
Neel Chauhan
45b28167d7
In count_acceptable_nodes(), count direct and indirect nodes with node_has_preferred_descriptor()
2018-11-05 08:26:02 -05:00
rl1987
5cc86e364f
Generate NETINFO cell using trunnel
2018-10-26 12:58:42 +03:00
rl1987
d3e6112bb2
Use trunnel for NETINFO cell parsing
2018-10-26 12:58:42 +03:00
David Goulet
9ba16c4d03
hs-v3: Close client intro circuits if the descriptor is replaced
...
When storing a descriptor in the client cache, if we are about to replace an
existing descriptor, make sure to close every introduction circuits of the old
descriptor so we don't have leftovers lying around.
Ticket 27471 describes a situation where tor is sending an INTRODUCE1 cell on
an introduction circuit for which it doesn't have a matching intro point
object (taken from the descriptor).
The main theory is that, after a new descriptor showed up, the introduction
points changed which led to selecting an introduction circuit not used by the
service anymore thus for which we are unable to find the corresponding
introduction point within the descriptor we just fetched.
Closes #27471 .
Signed-off-by: David Goulet <dgoulet@torproject.org>
2018-10-18 12:56:51 -04:00
Nick Mathewson
b1891068f1
Merge branch 'maint-0.3.4'
2018-10-17 13:02:23 -04:00
Nick Mathewson
e97adaf8dc
Argh. The unset value for OwningControllerFD is NOT -1.
2018-10-16 17:57:04 -04:00
Nick Mathewson
56a3cef4d7
Merge branch 'bug27849_redux'
2018-10-16 17:33:58 -04:00
rl1987
89c4a3a0b6
Write a comment to explain may_need_rebind condition
2018-10-15 16:18:31 +03:00
rl1987
9bb00a74bc
Refrain from listener rebinding when address families differ
2018-10-15 16:18:31 +03:00
Nick Mathewson
df2b46d18c
Remove a double-newline and improve a comment
2018-10-14 15:33:39 -04:00
Nick Mathewson
2dccef0eb4
Merge branch 'bug27772_squashed'
2018-10-14 15:31:52 -04:00
Nick Mathewson
dddecee291
Initialize some locals in socks5 parsing code.
...
These confused GCC LTO, which thought they might be used
uninitialized. I'm pretty sure that as long as 'res' indicates
success, they will always be set to something, but let's unconfuse
the compiler in any case.
2018-10-14 15:25:16 -04:00
Nick Mathewson
370d9922a4
Use the correct function signatures in test_relaycell.c
...
This is now officially an antipattern: please let's never copy a
function declaration in two places again. That's what headers are
for.
2018-10-14 15:25:16 -04:00
Nick Mathewson
965549aa07
Use assertions so GCC LTO doesn't worry about TLS channel conversion
...
Part of #27772
2018-10-14 15:25:16 -04:00
Nick Mathewson
67351f6724
Merge remote-tracking branch 'tor-github/pr/380'
2018-10-12 11:39:37 -04:00
rl1987
9d886185c1
Make sure we're removing conn from old_conns *once*
2018-10-03 15:51:59 +03:00
rl1987
2b146bdb9a
Refrain from using SMARTLIST_DEL_CURRENT in retry_all_listeners
2018-10-03 15:31:49 +03:00
Nick Mathewson
886dc8b0a5
Remove routerparse include from files that dont use it
2018-10-01 11:35:11 -05:00
Nick Mathewson
d199348664
Remove versions.h include from routerparse.h
2018-10-01 11:22:47 -05:00
Nick Mathewson
35db3f8162
Extract addr-policy parsing code.
2018-10-01 11:17:19 -05:00
Nick Mathewson
95e2eb9083
Move summarize_protover_flags to versions.c
2018-10-01 10:48:55 -05:00
Nick Mathewson
4201203845
extract networkstatus parsing to its own file.
2018-10-01 10:46:00 -05:00
Nick Mathewson
cd23903427
Pull detached-signatures code into dirauth.
2018-10-01 10:46:00 -05:00
Nick Mathewson
2be35f4d61
Split microdescriptor parser into its own file.
2018-10-01 10:46:00 -05:00
Nick Mathewson
82f4d3ca75
Move v2 hs parsing into feature/rend
2018-10-01 00:09:00 -05:00
Nick Mathewson
430ca38f70
Split the authority-cert and signature/hash code from routerparse
2018-10-01 00:09:00 -05:00