[or-cvs] backport some minimal hidserv bugfixes.
Roger Dingledine
arma at seul.org
Mon Jan 17 18:50:47 UTC 2005
Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/0091/tor/src/or
Modified Files:
Tag: tor-0_0_9-patches
circuituse.c rendservice.c
Log Message:
backport some minimal hidserv bugfixes.
we still don't cannibalize circs, don't preemptively build internal circs
if we've needed them lately, and we expire rend circs after 30 secs.
Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.38.2.1
retrieving revision 1.38.2.2
diff -u -d -r1.38.2.1 -r1.38.2.2
--- circuituse.c 10 Jan 2005 04:36:47 -0000 1.38.2.1
+++ circuituse.c 17 Jan 2005 18:50:45 -0000 1.38.2.2
@@ -897,6 +897,12 @@
/* one is already established, attach */
log_fn(LOG_INFO,"rend joined circ %d already here. attaching. (stream %d sec old)",
rendcirc->n_circ_id, conn_age);
+ /* Mark rendezvous circuits as 'newly dirty' every time you use
+ * them, since the process of rebuilding a rendezvous circ is so
+ * expensive. There is a tradeoffs between linkability and
+ * feasibility, at this point.
+ */
+ rendcirc->timestamp_dirty = time(NULL);
link_apconn_to_circ(conn, rendcirc);
if (connection_ap_handshake_send_begin(conn, rendcirc) < 0)
return 0; /* already marked, let them fade away */
Index: rendservice.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendservice.c,v
retrieving revision 1.111
retrieving revision 1.111.2.1
diff -u -d -r1.111 -r1.111.2.1
--- rendservice.c 7 Dec 2004 17:49:14 -0000 1.111
+++ rendservice.c 17 Jan 2005 18:50:45 -0000 1.111.2.1
@@ -50,7 +50,7 @@
int n_intro_circuits_launched; /**< count of intro circuits we have
* established in this period. */
rend_service_descriptor_t *desc;
- int desc_is_dirty;
+ time_t desc_is_dirty;
time_t next_upload_time;
} rend_service_t;
@@ -645,7 +645,7 @@
circuit->n_circ_id);
goto err;
}
- service->desc_is_dirty = 1;
+ service->desc_is_dirty = time(NULL);
circuit->purpose = CIRCUIT_PURPOSE_S_INTRO;
return 0;
@@ -833,7 +833,8 @@
intro, service->service_id);
tor_free(intro);
smartlist_del(service->intro_nodes,j--);
- changed = service->desc_is_dirty = 1;
+ service->desc_is_dirty = now;
+ changed = 1;
}
smartlist_add(intro_routers, router);
}
@@ -915,9 +916,9 @@
}
if (service->next_upload_time < now ||
(service->desc_is_dirty &&
- service->next_upload_time < now-5)) {
+ service->desc_is_dirty < now-5)) {
/* if it's time, or if the directory servers have a wrong service
- * descriptor and this has been the case for 5 seconds, upload a
+ * descriptor and ours has been stable for 5 seconds, upload a
* new one. */
upload_service_descriptor(service);
service->next_upload_time = now + rendpostperiod;
More information about the tor-commits
mailing list