aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-13 16:23:28 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-13 16:23:28 +0000
commitd48f6425e5c7822a0852d94450fdaa8625e95003 (patch)
treebd470afc3702e98b84a4a0ff523f2308e4892448 /src
parent2ee191e267379eb87251942fbf5ea46ff88f1d1b (diff)
downloadtor-d48f6425e5c7822a0852d94450fdaa8625e95003.tar
tor-d48f6425e5c7822a0852d94450fdaa8625e95003.tar.gz
r18066@catbus: nickm | 2008-02-13 11:22:19 -0500
Bugfix from Karsten: "Reversed r13439; v2 rendezvous descriptors were only re-fetched when a directory connection did not finish, not when a directory correctly replied with an error code like 404; bug found by nwf. svn:r13492
Diffstat (limited to 'src')
-rw-r--r--src/or/connection.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index eeaebbccd..6f602a9e4 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -477,12 +477,15 @@ connection_about_to_close_connection(connection_t *conn)
/* It's a directory connection and connecting or fetching
* failed: forget about this router, and maybe try again. */
connection_dir_request_failed(dir_conn);
- /* if we were trying to fetch a v2 rend desc, retry as needed */
- if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC_V2)
- rend_client_refetch_v2_renddesc(dir_conn->rend_query);
}
if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC)
rend_client_desc_here(dir_conn->rend_query); /* give it a try */
+ /* If we were trying to fetch a v2 rend desc and did not succeed,
+ * retry as needed. (If a fetch is successful, the connection state
+ * is changed to DIR_PURPOSE_HAS_FETCHED_RENDDESC to mark that
+ * refetching is unnecessary.) */
+ if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC_V2)
+ rend_client_refetch_v2_renddesc(dir_conn->rend_query);
break;
case CONN_TYPE_OR:
or_conn = TO_OR_CONN(conn);