diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-03-12 04:22:01 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-03-12 04:22:01 +0000 |
commit | 115271f65e1b84cea09f0fb401afb123f22b075b (patch) | |
tree | ab148aad2c1d2f5e320011b8507507817e48c918 /src/or/connection_edge.c | |
parent | d1f790e9cec42783e47805a8593ca5532a525904 (diff) | |
download | tor-115271f65e1b84cea09f0fb401afb123f22b075b.tar.gz tor-115271f65e1b84cea09f0fb401afb123f22b075b.zip |
Implement the common case of ATTACHSTREAM.
svn:r3751
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 4e8b15a116..dab25f7a3f 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -839,16 +839,22 @@ static int connection_ap_handshake_process_socks(connection_t *conn) { return 0; } rep_hist_note_used_resolve(time(NULL)); /* help predict this next time */ + control_event_stream_status(conn, STREAM_EVENT_NEW_RESOLVE); } else { /* socks->command == SOCKS_COMMAND_CONNECT */ if (socks->port == 0) { log_fn(LOG_NOTICE,"Application asked to connect to port 0. Refusing."); return -1; } rep_hist_note_used_port(socks->port, time(NULL)); /* help predict this next time */ + control_event_stream_status(conn, STREAM_EVENT_NEW); + } + if (get_options()->ManageConnections) { + conn->state = AP_CONN_STATE_CIRCUIT_WAIT; + return connection_ap_handshake_attach_circuit(conn); + } else { + conn->state = AP_CONN_STATE_CONTROLLER_WAIT; + return 0; } - control_event_stream_status(conn, STREAM_EVENT_NEW); - conn->state = AP_CONN_STATE_CIRCUIT_WAIT; - return connection_ap_handshake_attach_circuit(conn); } else { /* it's a hidden-service request */ rend_cache_entry_t *entry; |