aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-06-19 17:08:11 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2009-06-19 17:08:11 +0200
commit2378e37a5d88bed8dfc27406a258f6ee00521e8e (patch)
treeac0c1ec9300c3681ad15e096149b58952e7b0df4
parent025f526e63ee17bab246677963301c6f5c3442d4 (diff)
downloadtor-2378e37a5d88bed8dfc27406a258f6ee00521e8e.tar.gz
tor-2378e37a5d88bed8dfc27406a258f6ee00521e8e.zip
Revert "Backport fix for bug 997."
This reverts commit da347295323ec288da4da91d5a925e2fd19d09bc.
-rw-r--r--ChangeLog7
-rw-r--r--src/or/connection_edge.c22
-rw-r--r--src/or/rendclient.c7
-rw-r--r--src/or/rendcommon.c5
4 files changed, 21 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index e12f40c7f1..c2c61865f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,13 +22,6 @@ Changes in version 0.2.0.35 - 2009-??-??
- When starting with a cache over a few days old, do not leak
memory for the obsolete router descriptors in it. Bugfix on
0.2.0.33; fixes bug 672.
- - Hidden service clients didn't use a cached service descriptor that
- was older than 15 minutes, but wouldn't fetch a new one either. Now,
- use a cached descriptor no matter how old it is and only fetch a new
- one when all introduction points fail. Fix for bug 997. Patch from
- Marcus Griep.
- - Fix refetching of hidden service descriptors when all introduction
- points have turned out to not work. Fixes more of bug 997.
Changes in version 0.2.0.34 - 2009-02-08
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index a513ea3c99..0474a469d7 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1610,12 +1610,24 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
rend_client_refetch_v2_renddesc(conn->rend_query);
rend_client_refetch_renddesc(conn->rend_query);
} else { /* r > 0 */
- conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;
- log_info(LD_REND, "Descriptor is here and fresh enough. Great.");
- if (connection_ap_handshake_attach_circuit(conn) < 0) {
- if (!conn->_base.marked_for_close)
+/** How long after we receive a hidden service descriptor do we consider
+ * it valid? */
+#define NUM_SECONDS_BEFORE_HS_REFETCH (60*15)
+ if (now - entry->received < NUM_SECONDS_BEFORE_HS_REFETCH) {
+ conn->_base.state = AP_CONN_STATE_CIRCUIT_WAIT;
+ log_info(LD_REND, "Descriptor is here and fresh enough. Great.");
+ if (connection_ap_handshake_attach_circuit(conn) < 0) {
connection_mark_unattached_ap(conn, END_STREAM_REASON_CANT_ATTACH);
- return -1;
+ return -1;
+ }
+ } else {
+ 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);
}
}
return 0;
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 98e9abc631..81e5c69d9d 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -412,9 +412,10 @@ rend_client_refetch_renddesc(const char *query)
}
}
-/** Unless we already have a descriptor for <b>rend_query</b> with at least
- * one (possibly) working introduction point in it, start a connection to a
- * hidden service directory to fetch a v2 rendezvous service descriptor. */
+/** Start a connection to a hidden service directory to fetch a v2
+ * rendezvous service descriptor for the base32-encoded service ID
+ * <b>query</b>.
+ */
void
rend_client_refetch_v2_renddesc(const char *query)
{
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index d2d5eb3779..28d422343a 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -783,11 +783,6 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e)
}
if (!*e)
return 0;
- tor_assert((*e)->parsed && (*e)->parsed->intro_nodes);
- /* XXX022 hack for now, to return "not found" if there are no intro
- * points remaining. See bug 997. */
- if (smartlist_len((*e)->parsed->intro_nodes) == 0)
- return 0;
return 1;
}