[or-cvs] r8829: Add a CLEARDNSCACHE signal to clear the client-side DNS cach (in tor/trunk: . doc src/or)

nickm at seul.org nickm at seul.org
Wed Oct 25 21:46:27 UTC 2006


Author: nickm
Date: 2006-10-25 17:46:21 -0400 (Wed, 25 Oct 2006)
New Revision: 8829

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/doc/control-spec.txt
   tor/trunk/src/or/control.c
   tor/trunk/src/or/main.c
   tor/trunk/src/or/or.h
Log:
 r9389 at Kushana:  nickm | 2006-10-25 17:46:16 -0400
 Add a CLEARDNSCACHE signal to clear the client-side DNS cache.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r9389] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-10-25 21:39:42 UTC (rev 8828)
+++ tor/trunk/ChangeLog	2006-10-25 21:46:21 UTC (rev 8829)
@@ -30,6 +30,8 @@
       has changed.
     - Add a GETINFO events/names and GETINFO features/names so controllers
       can tell which events and features are supported.
+    - A new CLEARDNSCACHE signal to allow controllers to clear the
+      client-side DNS cache without expiring circuits.
 
   o Security bugfixes:
     - When the user sends a NEWNYM signal, clear the client-side DNS

Modified: tor/trunk/doc/control-spec.txt
===================================================================
--- tor/trunk/doc/control-spec.txt	2006-10-25 21:39:42 UTC (rev 8828)
+++ tor/trunk/doc/control-spec.txt	2006-10-25 21:46:21 UTC (rev 8829)
@@ -242,7 +242,8 @@
      "SIGNAL" SP Signal CRLF
 
      Signal = "RELOAD" / "SHUTDOWN" / "DUMP" / "DEBUG" / "HALT" /
-              "HUP" / "INT" / "USR1" / "USR2" / "TERM" / "NEWNYM"
+              "HUP" / "INT" / "USR1" / "USR2" / "TERM" / "NEWNYM" /
+              "CLEARDNSCACHE"
 
   The meaning of the signals are:
 
@@ -254,8 +255,10 @@
                    circuits. (like USR1)
       DEBUG     -- Debug: switch all open logs to loglevel debug. (like USR2)
       HALT      -- Immediate shutdown: clean up and exit now. (like TERM)
+      CLEARDNSCACHE -- Forget the client-side cached IPs for all hostnames.
       NEWNYM    -- Switch to clean circuits, so new application requests
-                   don't share any circuits with old ones.
+                   don't share any circuits with old ones.  Also clears
+                   the client-side DNS cache.
 
   The server responds with "250 OK" if the signal is recognized (or simply
   closes the socket if it was asked to close immediately), or "552

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-10-25 21:39:42 UTC (rev 8828)
+++ tor/trunk/src/or/control.c	2006-10-25 21:46:21 UTC (rev 8829)
@@ -1283,6 +1283,8 @@
       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);

Modified: tor/trunk/src/or/main.c
===================================================================
--- tor/trunk/src/or/main.c	2006-10-25 21:39:42 UTC (rev 8828)
+++ tor/trunk/src/or/main.c	2006-10-25 21:46:21 UTC (rev 8829)
@@ -1260,6 +1260,9 @@
     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 @@
       circuit_expire_all_dirty_circs();
       addressmap_clear_transient();
       break;
+    case SIGCLEARDNSCACHE:
+      addressmap_clear_transient();
+      break;
   }
 }
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-10-25 21:39:42 UTC (rev 8828)
+++ tor/trunk/src/or/or.h	2006-10-25 21:46:21 UTC (rev 8829)
@@ -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



More information about the tor-commits mailing list