diff options
author | Roger Dingledine <arma@torproject.org> | 2004-02-26 22:20:00 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-02-26 22:20:00 +0000 |
commit | 43156904ce255ffde246edb4e2bc1fae57d5a6d5 (patch) | |
tree | 81b1c1777fe255b03d4e81a3ed77e7d36286f041 | |
parent | 2c74f19d7e56fedbd3f598adbe15bff0a67c623f (diff) | |
download | tor-43156904ce255ffde246edb4e2bc1fae57d5a6d5.tar.gz tor-43156904ce255ffde246edb4e2bc1fae57d5a6d5.zip |
dump a new router.desc on hup
svn:r1128
-rw-r--r-- | src/or/main.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/or/main.c b/src/or/main.c index e67d3c8976..7f3a536775 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -487,10 +487,11 @@ static int do_main_loop(void) { please_dumpstats = 0; } if(please_reset) { + char keydir[512]; log_fn(LOG_WARN,"Received sighup. Reloading config."); /* first, reload config variables, in case they've changed */ + /* no need to provide argc/v, they've been cached inside init_from_config */ if (init_from_config(0, NULL) < 0) { - /* no need to provide argc/v, they've been cached inside init_from_config */ exit(1); } if(retry_all_connections() < 0) { @@ -499,7 +500,6 @@ static int do_main_loop(void) { } if(options.DirPort) { /* reload the approved-routers file */ - char keydir[512]; sprintf(keydir,"%s/approved-routers", options.DataDirectory); log_fn(LOG_INFO,"Reloading approved fingerprints from %s...",keydir); if(dirserv_parse_fingerprint_file(keydir) < 0) { @@ -509,6 +509,13 @@ static int do_main_loop(void) { /* fetch a new directory */ directory_initiate_command(router_pick_directory_server(), DIR_CONN_STATE_CONNECTING_FETCH); } + if(options.ORPort) { + router_rebuild_descriptor(); + sprintf(keydir,"%s/router.desc", options.DataDirectory); + log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir); + if (write_str_to_file(keydir, router_get_my_descriptor())) { + return -1; + } please_reset = 0; } |