[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Do not try to double-aquire lock when rotating keys. May f...



Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv13514/src/or

Modified Files:
	router.c 
Log Message:
Do not try to double-aquire lock when rotating keys.  May fix deadlock bug found by weasel.

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.145
retrieving revision 1.146
diff -u -d -r1.145 -r1.146
--- router.c	11 Feb 2005 01:26:47 -0000	1.145
+++ router.c	11 Feb 2005 07:56:10 -0000	1.146
@@ -129,13 +129,15 @@
     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.");