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

Add STREAM_EVENT_NEW for dns requests and tunneled connect_dir



I think these are the only two remaining stream types without a 
STREAM_EVENT_NEW event.

I also added a log_notice for the dns hijack tests.


Index: src/or/connection_edge.c
===================================================================
--- src/or/connection_edge.c    (revision 10649)
+++ src/or/connection_edge.c    (working copy)
@@ -1946,6 +1946,8 @@

   conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;

+  control_event_stream_status(conn, STREAM_EVENT_NEW, 0);
+
   /* attaching to a dirty circuit is fine */
   if (connection_ap_handshake_attach_circuit(conn) < 0) {
     connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH);
Index: src/or/dns.c
===================================================================
--- src/or/dns.c        (revision 10649)
+++ src/or/dns.c        (working copy)
@@ -1407,6 +1407,8 @@
   name[len] = '\0';
   strlcat(name, suffix, sizeof(name));

+  log_notice(LD_EXIT, "Testing DNS hijacking with a request for nonexistent 
hostname: %s", name);
+
   addr = tor_strdup(name);
   r = evdns_resolve_ipv4(name, DNS_QUERY_NO_SEARCH,
                          evdns_wildcard_check_callback, addr);
Index: src/or/dnsserv.c
===================================================================
--- src/or/dnsserv.c    (revision 10649)
+++ src/or/dnsserv.c    (working copy)
@@ -109,7 +109,6 @@
     return;
   }

-  /* XXXX020 Send a stream event to the controller. */

   /* Make a new dummy AP connection, and attach the request to it. */
   conn = TO_EDGE_CONN(connection_new(CONN_TYPE_AP, AF_INET));
@@ -131,6 +130,8 @@

   connection_add(TO_CONN(conn));

+  control_event_stream_status(TO_CONN(conn), STREAM_EVENT_NEW, 0);
+
   /* Now, throw the connection over to get rewritten (which will answer it
   * immediately if it's in the cache, or completely bogus, or automapped),
   * and then attached to a circuit. */


-- 

Browse Anonymously Anywhere	- http://anonymityanywhere.com
TorK	- KDE Anonymity Manager	- http://tork.sf.net
KlamAV	- KDE Anti-Virus 	- http://www.klamav.net