summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-03-12 05:04:16 +0000
committerRoger Dingledine <arma@torproject.org>2006-03-12 05:04:16 +0000
commita4da44c2b915b1260007082306620ccf2c3cf876 (patch)
treeeb7476059863d7b59cffc167cca74202df2a8749 /src/or/control.c
parentd80d5370e05e611f6edb027ccdf7da8d457cc30e (diff)
downloadtor-a4da44c2b915b1260007082306620ccf2c3cf876.tar.gz
tor-a4da44c2b915b1260007082306620ccf2c3cf876.zip
Now do address rewriting when the controller asks us to attach
to a particular circuit too. This will let Blossom specify "moria2.exit" without having to learn what moria2's IP address is. It may also cause other controller authors some angst. Let us know. svn:r6136
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 9224101f23..8f11e9c304 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1840,12 +1840,7 @@ handle_control_attachstream(connection_t *conn, uint32_t len,
ap_conn->state = AP_CONN_STATE_CONTROLLER_WAIT;
}
- if (zero_circ) {
- connection_ap_handshake_rewrite_and_attach(ap_conn);
- send_control_done(conn);
- return 0;
- }
- if (circ->state != CIRCUIT_STATE_OPEN) {
+ if (circ && circ->state != CIRCUIT_STATE_OPEN) {
if (STATE_IS_V0(conn->state))
send_control0_error(conn, ERR_INTERNAL,
"Refuse to attach stream to non-open circ.");
@@ -1855,7 +1850,7 @@ handle_control_attachstream(connection_t *conn, uint32_t len,
conn);
return 0;
}
- if (connection_ap_handshake_attach_chosen_circuit(ap_conn, circ) != 1) {
+ if (connection_ap_handshake_rewrite_and_attach(ap_conn, circ) < 0) {
if (STATE_IS_V0(conn->state))
send_control0_error(conn, ERR_INTERNAL, "Unable to attach stream.");
else