summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-15 01:08:59 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-15 01:08:59 +0000
commit26c1c8f173c0d7c7ac0b882ac12e88a74976d538 (patch)
tree24dd6ab0eafc89b97eae739f97fb94cbbb60c559 /src/or/connection_edge.c
parentac38746b3b2f0230695808ce715614e64ef1f7c2 (diff)
downloadtor-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
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c12
1 files changed, 10 insertions, 2 deletions
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;
}
}