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

[or-cvs] Backport tor-resolve fixes.



Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv30612/src/or

Modified Files:
      Tag: tor-0_0_9-patches
	dns.c connection_edge.c 
Log Message:
Backport tor-resolve fixes.

Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dns.c,v
retrieving revision 1.126.2.8
retrieving revision 1.126.2.9
diff -u -d -r1.126.2.8 -r1.126.2.9
--- dns.c	4 Feb 2005 03:05:12 -0000	1.126.2.8
+++ dns.c	5 Feb 2005 21:24:39 -0000	1.126.2.9
@@ -210,6 +210,8 @@
    * know the answer. */
   if (tor_inet_aton(exitconn->address, &in) != 0) {
     exitconn->addr = ntohl(in.s_addr);
+    if (exitconn->purpose == EXIT_PURPOSE_RESOLVE)
+      send_resolved_cell(exitconn, RESOLVED_TYPE_IPV4);
     return 1;
   }
 

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.264.2.6
retrieving revision 1.264.2.7
diff -u -d -r1.264.2.6 -r1.264.2.7
--- connection_edge.c	4 Feb 2005 02:52:43 -0000	1.264.2.6
+++ connection_edge.c	5 Feb 2005 21:24:39 -0000	1.264.2.7
@@ -878,16 +878,15 @@
   dummy_conn->state = EXIT_CONN_STATE_RESOLVEFAILED;
   dummy_conn->purpose = EXIT_PURPOSE_RESOLVE;
 
-  dummy_conn->next_stream = circ->resolving_streams;
-  circ->resolving_streams = dummy_conn;
-
   /* send it off to the gethostbyname farm */
   switch (dns_resolve(dummy_conn)) {
     case 1: /* The result was cached; a resolved cell was sent. */
     case -1:
-      /* dummy_conn got freed, don't touch it */
+      connection_free(dummy_conn);
       return 0;
     case 0: /* resolve added to pending list */
+      dummy_conn->next_stream = circ->resolving_streams;
+      circ->resolving_streams = dummy_conn;
       assert_circuit_ok(circ);
       ;
   }