aboutsummaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index de0aa7da20..f43ce19c83 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1,7 +1,7 @@
/* Copyright (c) 2001 Matej Pfajfar.
* Copyright (c) 2001-2004, Roger Dingledine.
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
- * Copyright (c) 2007-2011, The Tor Project, Inc. */
+ * Copyright (c) 2007-2012, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
@@ -1412,7 +1412,13 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
need_uptime = !conn->want_onehop && !conn->use_begindir &&
smartlist_string_num_isin(options->LongLivedPorts,
conn->socks_request->port);
- need_internal = desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL;
+
+ if (desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)
+ need_internal = 1;
+ else if (conn->use_begindir || conn->want_onehop)
+ need_internal = 1;
+ else
+ need_internal = 0;
circ = circuit_get_best(conn, 1, desired_circuit_purpose,
need_uptime, need_internal);