diff options
author | Nick Mathewson <nickm@torproject.org> | 2004-04-15 03:48:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2004-04-15 03:48:26 +0000 |
commit | 880ffd8f64d5ec854fe08f755a5afec3852abde6 (patch) | |
tree | a3e44d1884ed24b62929a7c9710ba7fc48eb68ff /src | |
parent | ddc11899b6b976a4cb1fd060940af9b69f2db541 (diff) | |
download | tor-880ffd8f64d5ec854fe08f755a5afec3852abde6.tar tor-880ffd8f64d5ec854fe08f755a5afec3852abde6.tar.gz |
Must detach before attaching, or else we infinite-loop
svn:r1632
Diffstat (limited to 'src')
-rw-r--r-- | src/or/connection_edge.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 010bd4356..975b7158a 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -232,6 +232,7 @@ int connection_edge_process_relay_cell_not_open( addr = ntohl(get_uint32(cell->payload+RELAY_HEADER_SIZE+1)); client_dns_set_entry(conn->socks_request->address, addr); conn->state = AP_CONN_STATE_CIRCUIT_WAIT; + circuit_detach_stream(circ,conn); if(connection_ap_handshake_attach_circuit(conn) >= 0) return 0; /* else, conn will get closed below */ @@ -240,6 +241,7 @@ int connection_edge_process_relay_cell_not_open( < MAX_RESOLVE_FAILURES) { /* We haven't retried too many times; reattach the connection. */ conn->state = AP_CONN_STATE_CIRCUIT_WAIT; + circuit_detach_stream(circ,conn); if(connection_ap_handshake_attach_circuit(conn) >= 0) return 0; /* else, conn will get closed below */ @@ -256,7 +258,6 @@ int connection_edge_process_relay_cell_not_open( return 0; } - if(conn->type == CONN_TYPE_AP && rh->command == RELAY_COMMAND_CONNECTED) { if(conn->state != AP_CONN_STATE_CONNECT_WAIT) { log_fn(LOG_WARN,"Got 'connected' while not in state connect_wait. Dropping."); |