summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-11-01 03:43:02 +0000
committerNick Mathewson <nickm@torproject.org>2007-11-01 03:43:02 +0000
commitd1df046e3b230d9b445d146577eab428c3f4aa0a (patch)
tree82034dfe1dd7411b20a2429ef395dedde14fa740 /src/or/connection_edge.c
parent5da5d2bd7926707dcd9d2a40e50f5b2f9f26745a (diff)
downloadtor-d1df046e3b230d9b445d146577eab428c3f4aa0a.tar.gz
tor-d1df046e3b230d9b445d146577eab428c3f4aa0a.zip
r16314@catbus: nickm | 2007-10-31 23:40:08 -0400
Clients download and cache new hidden descriptor format. svn:r12302
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index ba0d2a85a5..df7daa76c1 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1443,7 +1443,7 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
log_info(LD_REND,"Got a hidden service request for ID '%s'",
safe_str(conn->rend_query));
/* see if we already have it cached */
- r = rend_cache_lookup_entry(conn->rend_query, 0, &entry);
+ r = rend_cache_lookup_entry(conn->rend_query, -1, &entry);
if (r<0) {
log_warn(LD_BUG,"Invalid service name '%s'",
safe_str(conn->rend_query));
@@ -1454,6 +1454,9 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
conn->_base.state = AP_CONN_STATE_RENDDESC_WAIT;
log_info(LD_REND, "Unknown descriptor %s. Fetching.",
safe_str(conn->rend_query));
+ /* Fetch both, v0 and v2 rend descriptors in parallel. Use whichever
+ * arrives first. */
+ rend_client_refetch_v2_renddesc(conn->rend_query);
rend_client_refetch_renddesc(conn->rend_query);
} else { /* r > 0 */
/** How long after we receive a hidden service descriptor do we consider
@@ -1470,6 +1473,9 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
conn->_base.state = AP_CONN_STATE_RENDDESC_WAIT;
log_info(LD_REND, "Stale descriptor %s. Refetching.",
safe_str(conn->rend_query));
+ /* Fetch both, v0 and v2 rend descriptors in parallel. Use whichever
+ * arrives first. */
+ rend_client_refetch_v2_renddesc(conn->rend_query);
rend_client_refetch_renddesc(conn->rend_query);
}
}