aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-10-05 15:43:02 -0700
committerRobert Ransom <rransom.8774@gmail.com>2011-10-30 02:17:00 -0700
commitc60148c7f52e76397b79faaddf1bdb6204c4d170 (patch)
treecc14524d1d385f0bf910c64ac13f6f94efc81f29
parent6f220de7b947b82972b382bb874cea94715f25ed (diff)
downloadtor-c60148c7f52e76397b79faaddf1bdb6204c4d170.tar.gz
tor-c60148c7f52e76397b79faaddf1bdb6204c4d170.zip
Record the time at which each intro point was first published
-rw-r--r--src/or/or.h5
-rw-r--r--src/or/rendservice.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h
index f884c12ecc..cf241a6442 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3480,6 +3480,11 @@ typedef struct rend_intro_point_t {
* circuit to this intro point for some reason other than our
* circuit-build timeout. See also MAX_INTRO_POINT_REACHABILITY_FAILURES. */
unsigned int unreachable_count : 3;
+
+ /** (Service side only) The time at which this intro point was first
+ * published, or -1 if this intro point has not yet been
+ * published. */
+ time_t time_published;
} rend_intro_point_t;
/** Information used to connect to a hidden service. Used on both the
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 682d13deba..24d5937c5c 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -554,6 +554,13 @@ rend_service_update_descriptor(rend_service_t *service)
if (intro_svc->intro_key)
intro_desc->intro_key = crypto_pk_dup_key(intro_svc->intro_key);
smartlist_add(d->intro_nodes, intro_desc);
+
+ if (intro_svc->time_published == -1) {
+ /* We are publishing this intro point in a descriptor for the
+ * first time -- note the current time in the service's copy of
+ * the intro point. */
+ intro_svc->time_published = time(NULL);
+ }
}
}
@@ -1952,6 +1959,7 @@ rend_services_introduce(void)
intro->extend_info = extend_info_from_router(router);
intro->intro_key = crypto_new_pk_env();
tor_assert(!crypto_pk_generate_key(intro->intro_key));
+ intro->time_published = -1;
smartlist_add(service->intro_nodes, intro);
log_info(LD_REND, "Picked router %s as an intro point for %s.",
safe_str_client(router_describe(router)),