aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/config.c4
-rw-r--r--src/or/cpuworker.c3
-rw-r--r--src/or/dns.c3
-rw-r--r--src/or/main.c7
4 files changed, 7 insertions, 10 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 70472f3cc..e1f0acc9b 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -432,8 +432,8 @@ options_act(void)
return -1;
}
- /* Bail out at this point if we're not going to be a server: we want
- * to not fork, and to log stuff to stderr. */
+ /* Bail out at this point if we're not going to be a client or server:
+ * we want to not fork, and to log stuff to stderr. */
if (options->command != CMD_RUN_TOR)
return 0;
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index eb264bfcf..d1c0f0e04 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -46,8 +46,7 @@ static void process_pending_task(connection_t *cpuworker);
void
cpu_init(void)
{
- last_rotation_time=time(NULL);
- spawn_enough_cpuworkers();
+ cpuworkers_rotate();
}
/** Called when we're done sending a request to a cpuworker. */
diff --git a/src/or/dns.c b/src/or/dns.c
index db54054ff..21ff68924 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -102,8 +102,6 @@ void
dns_init(void)
{
init_cache_tree();
- last_rotation_time=time(NULL);
- spawn_enough_dnsworkers();
}
/** Helper: free storage held by an entry in the DNS cache. */
@@ -718,7 +716,6 @@ void
dnsworkers_rotate(void)
{
connection_t *dnsconn;
- log_fn(LOG_INFO, "Rotating DNS workers.");
while ((dnsconn = connection_get_by_type_state(CONN_TYPE_DNSWORKER,
DNSWORKER_STATE_IDLE))) {
connection_mark_for_close(dnsconn);
diff --git a/src/or/main.c b/src/or/main.c
index ee623045e..e33b19c8e 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -934,7 +934,7 @@ do_hup(void)
* configuration options. */
cpuworkers_rotate();
dnsworkers_rotate();
- /* Rebuild fresh descriptor, but leave old one on failure. */
+ /* Write out a fresh descriptor, but leave old one on failure. */
router_rebuild_descriptor(1);
descriptor = router_get_my_descriptor();
if (!descriptor) {
@@ -957,9 +957,10 @@ do_main_loop(void)
{
int loop_result;
+ dns_init(); /* initialize the dns resolve tree */
/* only spawn dns handlers if we're a router */
if (server_mode(get_options())) {
- dns_init(); /* initialize the dns resolve tree, and spawn workers */
+ dnsworkers_rotate();
}
handle_signals(1);
@@ -1750,7 +1751,7 @@ nt_service_install(void)
if (tor_snprintf(command, len, "\"%s\" --nt-service -f \"%s%storrc\"",
szPath, szDrive, szDir)<0) {
printf("Failed: tor_snprinf()\n");
- free(command);
+ tor_free(command);
return 0;
}