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

[or-cvs] bugfix: tor-resolve requests were ignoring .exit if there was



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

Modified Files:
	circuituse.c 
Log Message:
bugfix: tor-resolve requests were ignoring .exit if there was
a working circuit they could use instead.


Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- circuituse.c	1 Feb 2005 00:37:16 -0000	1.48
+++ circuituse.c	2 Feb 2005 06:26:52 -0000	1.49
@@ -85,17 +85,15 @@
                                 conn->socks_request->port))
     return 0;
 
-  if (conn->socks_request->command == SOCKS_COMMAND_CONNECT) {
-    if (purpose == CIRCUIT_PURPOSE_C_GENERAL) {
-      if (!connection_ap_can_use_exit(conn, exitrouter)) {
-        /* can't exit from this router */
-        return 0;
-      }
-    } else { /* not general */
-      if (rend_cmp_service_ids(conn->rend_query, circ->rend_query)) {
-        /* this circ is not for this conn */
-        return 0;
-      }
+  if (purpose == CIRCUIT_PURPOSE_C_GENERAL) {
+    if (!connection_ap_can_use_exit(conn, exitrouter)) {
+      /* can't exit from this router */
+      return 0;
+    }
+  } else { /* not general */
+    if (rend_cmp_service_ids(conn->rend_query, circ->rend_query)) {
+      /* this circ is not for this conn */
+      return 0;
     }
   }
   return 1;
@@ -958,10 +956,12 @@
 
     link_apconn_to_circ(conn, circ);
     tor_assert(conn->socks_request);
-    if (conn->socks_request->command == SOCKS_COMMAND_CONNECT)
+    if (conn->socks_request->command == SOCKS_COMMAND_CONNECT) {
+//      consider_recording_trackhost(conn, circ);
       connection_ap_handshake_send_begin(conn, circ);
-    else
+    } else {
       connection_ap_handshake_send_resolve(conn, circ);
+    }
 
     return 1;
   } else { /* we're a rendezvous conn */