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

[or-cvs] Also set event_mask=0 in connection_free_all, and dont send...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv13087/src/or

Modified Files:
	control.c connection.c 
Log Message:
Also set event_mask=0 in connection_free_all, and dont send events to marked control conns (for good measure)

Index: control.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- control.c	7 Aug 2005 19:20:55 -0000	1.113
+++ control.c	7 Aug 2005 19:27:38 -0000	1.114
@@ -523,6 +523,7 @@
   get_connection_array(&conns, &n_conns);
   for (i = 0; i < n_conns; ++i) {
     if (conns[i]->type == CONN_TYPE_CONTROL &&
+        !conns[i]->marked_for_close &&
         conns[i]->state == CONTROL_CONN_STATE_OPEN_V0 &&
         conns[i]->event_mask & (1<<event)) {
       send_control0_message(conns[i], CONTROL0_CMD_EVENT, buflen, buf);
@@ -560,6 +561,7 @@
   get_connection_array(&conns, &n_conns);
   for (i = 0; i < n_conns; ++i) {
     if (conns[i]->type == CONN_TYPE_CONTROL &&
+        !conns[i]->marked_for_close &&
         conns[i]->state == CONTROL_CONN_STATE_OPEN_V1 &&
         conns[i]->event_mask & (1<<event)) {
       connection_write_to_buf(buf, len, conns[i]);

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.392
retrieving revision 1.393
diff -u -d -r1.392 -r1.393
--- connection.c	7 Aug 2005 19:20:55 -0000	1.392
+++ connection.c	7 Aug 2005 19:27:38 -0000	1.393
@@ -276,6 +276,13 @@
   connection_t **carray;
 
   get_connection_array(&carray,&n);
+
+  /* We don't want to log any messages to controllers. */
+  for (i=0;i<n;i++)
+    if (carray[i]->type == CONN_TYPE_CONTROL)
+      carray[i]->event_mask = 0;
+  control_update_global_event_mask();
+
   for (i=0;i<n;i++)
     _connection_free(carray[i]);