aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-25 21:46:21 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-25 21:46:21 +0000
commit3fbb292bfff2765c4e541763e4e40e068e55e4ab (patch)
treed08410be5b47a1a5558a053458ee54b846e6ad67 /src/or
parent5c670a186c1f45a2ddfcab00c065f994d8a888f7 (diff)
downloadtor-3fbb292bfff2765c4e541763e4e40e068e55e4ab.tar.gz
tor-3fbb292bfff2765c4e541763e4e40e068e55e4ab.zip
r9389@Kushana: nickm | 2006-10-25 17:46:16 -0400
Add a CLEARDNSCACHE signal to clear the client-side DNS cache. svn:r8829
Diffstat (limited to 'src/or')
-rw-r--r--src/or/control.c2
-rw-r--r--src/or/main.c6
-rw-r--r--src/or/or.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 60a233211d..036323d2b4 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1283,6 +1283,8 @@ handle_control_signal(control_connection_t *conn, uint32_t len,
sig = SIGTERM;
else if (!strcasecmp(s, "NEWNYM"))
sig = SIGNEWNYM;
+ else if (!strcasecmp(s, "CLEARDNSCACHE"))
+ sig = SIGCLEARDNSCACHE;
else {
connection_printf_to_buf(conn, "552 Unrecognized signal code \"%s\"\r\n",
s);
diff --git a/src/or/main.c b/src/or/main.c
index 0dafa54050..c580eb243a 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -1260,6 +1260,9 @@ control_signal_act(int the_signal)
case SIGNEWNYM:
signal_callback(0,0,(void*)(uintptr_t)SIGNEWNYM);
break;
+ case SIGCLEARDNSCACHE:
+ signal_callback(0,0,(void*)(uintptr_t)SIGCLEARDNSCACHE);
+ break;
default:
log_warn(LD_BUG, "Unrecognized signal number %d.", the_signal);
break;
@@ -1320,6 +1323,9 @@ signal_callback(int fd, short events, void *arg)
circuit_expire_all_dirty_circs();
addressmap_clear_transient();
break;
+ case SIGCLEARDNSCACHE:
+ addressmap_clear_transient();
+ break;
}
}
diff --git a/src/or/or.h b/src/or/or.h
index 9036ef0192..bdae373601 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -147,6 +147,7 @@
/* Controller signals start at a high number so we don't
* conflict with system-defined signals. */
#define SIGNEWNYM 129
+#define SIGCLEARDNSCACHE 130
#if (SIZEOF_CELL_T != 0)
/* On Irix, stdlib.h defines a cell_t type, so we need to make sure