[or-cvs] [tor/master] Fix more of bug 997.

Nick Mathewson nickm at seul.org
Tue Jun 16 20:26:38 UTC 2009


Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Sat, 13 Jun 2009 12:21:58 +0200
Subject: Fix more of bug 997.
Commit: ca8708a9ce3f8e6a4b3aadf2e35edfd2b49c1a2d

Fix refetching of hidden service descriptors when all introduction points
have turned out to not work.
---
 ChangeLog           |    2 ++
 src/or/rendclient.c |    7 +++----
 src/or/rendcommon.c |    5 +++++
 3 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index d2a2261..2e4eadc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,8 @@ Changes in version 0.2.2.1-alpha - 2009-??-??
       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.
 
   o Deprecated and removed features:
     - The controller no longer accepts the old obsolete "addr-mappings/"
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index d9c0a9e..00b77d8 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -447,10 +447,9 @@ directory_get_from_hs_dir(const char *desc_id, const rend_data_t *rend_query)
   return 1;
 }
 
-/** Start a connection to a hidden service directory to fetch a v2
- * rendezvous service descriptor for the base32-encoded service ID
- * <b>query</b>.
- */
+/** 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. */
 void
 rend_client_refetch_v2_renddesc(const rend_data_t *rend_query)
 {
diff --git a/src/or/rendcommon.c b/src/or/rendcommon.c
index c813c49..df7195e 100644
--- a/src/or/rendcommon.c
+++ b/src/or/rendcommon.c
@@ -911,6 +911,11 @@ 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;
 }
 
-- 
1.5.6.5



More information about the tor-commits mailing list