]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a startup time assert caused by periodic events not being initialized.
authorYawning Angel <yawning@schwanenlied.me>
Wed, 18 Nov 2015 11:27:24 +0000 (11:27 +0000)
committerYawning Angel <yawning@schwanenlied.me>
Wed, 18 Nov 2015 11:31:05 +0000 (11:31 +0000)
Loading a on disk bridge descriptor causes a directory download to be
scheduled, which asserts due to the periodic events not being
initialized yet.

Fixes bug #17635, not in any released version of tor.

src/or/main.c

index 0b8591f1d4d16bf78e8e1c168107c8eab127fcec..7aeacd138d1d714c81b537740cba287993935651 100644 (file)
@@ -2299,6 +2299,13 @@ do_main_loop(void)
 {
   time_t now;
 
+  /* initialize the periodic events first, so that code that depends on the
+   * events being present does not assert.
+   */
+  if (! periodic_events_initialized) {
+    initialize_periodic_events();
+  }
+
   /* initialize dns resolve map, spawn workers if needed */
   if (dns_init() < 0) {
     if (get_options()->ServerDNSAllowBrokenConfig)
@@ -2401,10 +2408,6 @@ do_main_loop(void)
     tor_assert(second_timer);
   }
 
-  if (! periodic_events_initialized) {
-    initialize_periodic_events();
-  }
-
 #ifdef HAVE_SYSTEMD_209
   uint64_t watchdog_delay;
   /* set up systemd watchdog notification. */