summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-09-22 17:40:04 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-22 17:40:04 -0400
commitae0cb94b69b65e4561932b668deb0b19a19dbe94 (patch)
tree54588411afc5264e34214470b12b32548f4debb0
parent7d9bea6a773cc18c4790883cb18e3e61131a4ab1 (diff)
downloadtor-ae0cb94b69b65e4561932b668deb0b19a19dbe94.tar.gz
tor-ae0cb94b69b65e4561932b668deb0b19a19dbe94.zip
Initialize mainloop events earlier, since other stuff may run them.
Fixes a stem test failure; bugfix on c7ce6b9821be22e734b79e0. Bug not in any released Tor.
-rw-r--r--src/app/main/main.c1
-rw-r--r--src/core/mainloop/mainloop.c2
-rw-r--r--src/core/mainloop/mainloop.h2
3 files changed, 3 insertions, 2 deletions
diff --git a/src/app/main/main.c b/src/app/main/main.c
index eeb219f3dc..d71e1c7bf2 100644
--- a/src/app/main/main.c
+++ b/src/app/main/main.c
@@ -1269,6 +1269,7 @@ run_tor_main_loop(void)
handle_signals();
monotime_init();
timers_initialize();
+ initialize_mainloop_events();
/* load the private keys, if we're supposed to have them, and set up the
* TLS context. */
diff --git a/src/core/mainloop/mainloop.c b/src/core/mainloop/mainloop.c
index 306c78735b..4e13090948 100644
--- a/src/core/mainloop/mainloop.c
+++ b/src/core/mainloop/mainloop.c
@@ -2675,7 +2675,7 @@ dns_servers_relaunch_checks(void)
}
/** Initialize some mainloop_event_t objects that we require. */
-STATIC void
+void
initialize_mainloop_events(void)
{
if (!schedule_active_linked_connections_event) {
diff --git a/src/core/mainloop/mainloop.h b/src/core/mainloop/mainloop.h
index e3a5acd0d0..632733d9a6 100644
--- a/src/core/mainloop/mainloop.h
+++ b/src/core/mainloop/mainloop.h
@@ -87,6 +87,7 @@ void do_signewnym(time_t);
time_t get_last_signewnym_time(void);
void tor_init_connection_lists(void);
+void initialize_mainloop_events(void);
void tor_mainloop_free_all(void);
struct token_bucket_rw_t;
@@ -97,7 +98,6 @@ extern struct token_bucket_rw_t global_bucket;
extern struct token_bucket_rw_t global_relayed_bucket;
#ifdef MAINLOOP_PRIVATE
-STATIC void initialize_mainloop_events(void);
STATIC void close_closeable_connections(void);
STATIC void initialize_periodic_events(void);
STATIC void teardown_periodic_events(void);