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

[or-cvs] Implement NEWNYM. Nick, did I do a bad thing?



Update of /home2/or/cvsroot/tor/src/or
In directory moria:/home/arma/work/onion/cvs/tor/src/or

Modified Files:
	control.c main.c or.h 
Log Message:
Implement NEWNYM. Nick, did I do a bad thing?


Index: control.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.173
retrieving revision 1.174
diff -u -p -d -r1.173 -r1.174
--- control.c	8 Mar 2006 22:29:07 -0000	1.173
+++ control.c	9 Mar 2006 00:18:15 -0000	1.174
@@ -1118,6 +1118,8 @@ handle_control_signal(connection_t *conn
       sig = SIGUSR2;
     else if (!strcasecmp(s, "HALT") || !strcasecmp(s, "TERM"))
       sig = SIGTERM;
+    else if (!strcasecmp(s, "NEWNYM"))
+      sig = SIGNEWNYM;
     else {
       connection_printf_to_buf(conn, "552 Unrecognized signal code \"%s\"\r\n",
                                s);

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.626
retrieving revision 1.627
diff -u -p -d -r1.626 -r1.627
--- main.c	9 Mar 2006 00:10:28 -0000	1.626
+++ main.c	9 Mar 2006 00:18:16 -0000	1.627
@@ -1220,6 +1220,9 @@ control_signal_act(int the_signal)
     case 15:
       signal_callback(0,0,(void*)(uintptr_t)SIGTERM);
       break;
+    case SIGNEWNYM:
+      signal_callback(0,0,(void*)(uintptr_t)SIGNEWNYM);
+      break;
     default:
       return -1;
     }
@@ -1274,6 +1277,9 @@ signal_callback(int fd, short events, vo
                                                 zombies */
       break;
 #endif
+    case SIGNEWNYM:
+      circuit_expire_all_dirty_circs();
+      break;
   }
 }
 

Index: or.h
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.800
retrieving revision 1.801
diff -u -p -d -r1.800 -r1.801
--- or.h	8 Mar 2006 22:29:08 -0000	1.800
+++ or.h	9 Mar 2006 00:18:16 -0000	1.801
@@ -157,6 +157,9 @@
 #ifndef SIGTERM
 #define SIGTERM 15
 #endif
+/* Controller signals start at a high number so we don't
+ * conflict with system-defined signals. */
+#define SIGNEWNYM 129
 
 #if (SIZEOF_CELL_T != 0)
 /* On Irix, stdlib.h defines a cell_t type, so we need to make sure