From: Roger Dingledine Date: Wed, 2 Feb 2005 06:26:52 +0000 (+0000) Subject: bugfix: tor-resolve requests were ignoring .exit if there was X-Git-Tag: tor-0.1.0.1-rc~338 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1656f41b40645f541795b995c5cdbf50ffa785d;p=thirdparty%2Ftor.git bugfix: tor-resolve requests were ignoring .exit if there was a working circuit they could use instead. svn:r3502 --- diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 590a71bc4b..0cf3651d7e 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -85,17 +85,15 @@ static int circuit_is_acceptable(circuit_t *circ, 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 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) { 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 */