diff options
author | Roger Dingledine <arma@torproject.org> | 2004-04-15 01:08:59 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2004-04-15 01:08:59 +0000 |
commit | 26c1c8f173c0d7c7ac0b882ac12e88a74976d538 (patch) | |
tree | 24dd6ab0eafc89b97eae739f97fb94cbbb60c559 | |
parent | ac38746b3b2f0230695808ce715614e64ef1f7c2 (diff) | |
download | tor-26c1c8f173c0d7c7ac0b882ac12e88a74976d538.tar.gz tor-26c1c8f173c0d7c7ac0b882ac12e88a74976d538.zip |
make unattached rend streams expire after a while (60s)
(they were darned persistent)
also make intro circs that are waiting for acks expire after a while (20s)
svn:r1628
-rw-r--r-- | src/or/circuit.c | 8 | ||||
-rw-r--r-- | src/or/connection_edge.c | 12 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 78a16b9d1d..44e5d438a6 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -485,12 +485,12 @@ void circuit_expire_building(time_t now) { victim->purpose == CIRCUIT_PURPOSE_C_INTRODUCE_ACK_WAIT) && victim->timestamp_dirty + MIN_SECONDS_BEFORE_EXPIRING_CIRC > now)) { if(victim->n_conn) - log_fn(LOG_INFO,"Abandoning circ %s:%d:%d (state %d:%s)", + log_fn(LOG_INFO,"Abandoning circ %s:%d:%d (state %d:%s, purpose %d)", victim->n_conn->address, victim->n_port, victim->n_circ_id, - victim->state, circuit_state_to_string[victim->state]); + victim->state, circuit_state_to_string[victim->state], victim->purpose); else - log_fn(LOG_INFO,"Abandoning circ %d (state %d:%s)", victim->n_circ_id, - victim->state, circuit_state_to_string[victim->state]); + log_fn(LOG_INFO,"Abandoning circ %d (state %d:%s, purpose %d)", victim->n_circ_id, + victim->state, circuit_state_to_string[victim->state], victim->purpose); circuit_log_path(LOG_INFO,victim); circuit_mark_for_close(victim); } diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 7f0ae432d2..010bd4356a 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -871,6 +871,12 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) { assert(conn->state == AP_CONN_STATE_CIRCUIT_WAIT); assert(conn->socks_request); + if(conn->timestamp_created < time(NULL)-60) { + /* XXX make this cleaner than '60' */ + log_fn(LOG_WARN,"Giving up on attached circ (60s late)."); + connection_mark_for_close(conn, 0); + } + if(!connection_edge_is_rendezvous_stream(conn)) { /* we're a general conn */ circuit_t *circ=NULL; @@ -941,8 +947,10 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) { if(rend_client_send_introduction(introcirc, rendcirc) < 0) { return -1; } - if(!rendcirc->timestamp_dirty) - rendcirc->timestamp_dirty = time(NULL); + assert(!rendcirc->timestamp_dirty); + rendcirc->timestamp_dirty = time(NULL); + assert(!introcirc->timestamp_dirty); + introcirc->timestamp_dirty = time(NULL); return 0; } } |