]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Do not try to double-aquire lock when rotating keys. May fix deadlock bug found...
authorNick Mathewson <nickm@torproject.org>
Fri, 11 Feb 2005 07:56:10 +0000 (07:56 +0000)
committerNick Mathewson <nickm@torproject.org>
Fri, 11 Feb 2005 07:56:10 +0000 (07:56 +0000)
svn:r3616

src/or/router.c

index 4d63b914d2d6b51cbf704d2a726541b0eb39c094..0cb45def30f49b2d061c8dc2c873d764f610ecfb 100644 (file)
@@ -129,13 +129,15 @@ void rotate_onion_key(void)
     log(LOG_ERR, "Couldn't write generated key to %s.", fname);
     goto error;
   }
+  log_fn(LOG_INFO, "Rotating onion key");
   tor_mutex_acquire(key_lock);
   if (lastonionkey)
     crypto_free_pk_env(lastonionkey);
-  log_fn(LOG_INFO, "Rotating onion key");
   lastonionkey = onionkey;
-  set_onion_key(prkey);
+  onionkey = prkey;
+  onionkey_set_at = time(NULL);
   tor_mutex_release(key_lock);
+  mark_my_descriptor_dirty();
   return;
  error:
   log_fn(LOG_WARN, "Couldn't rotate onion key.");