summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-23 12:47:39 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-23 12:47:39 -0400
commit55b21b366c4a8c237dda0a967c0c499e18fb0b4c (patch)
tree954857a95b9af8bce315dd0da266a0450da28e7b /src/or/routerlist.c
parent482e3cfa0969775233d3f903639c44f32ddaf820 (diff)
downloadtor-55b21b366c4a8c237dda0a967c0c499e18fb0b4c.tar.gz
tor-55b21b366c4a8c237dda0a967c0c499e18fb0b4c.zip
fixup! Make router_pick_directory_server respect PDS_NO_EXISTING_*
Document n_busy_out, and set it correctly when we goto retry_without_exclude.
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index e0cb5174c3..e65898636a 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1383,6 +1383,10 @@ router_pick_dirserver_generic(smartlist_t *sourcelist,
*
* If the PDS_PREFER_TUNNELED_DIR_CONNS_ flag is set, prefer directory servers
* that we can use with BEGINDIR.
+ *
+ * If <b>n_busy_out</b> is provided, set *<b>n_busy_out</b> to the number of
+ * directories that we excluded for no other reason than
+ * PDS_NO_EXISTING_SERVERDESC_FETCH or PDS_NO_EXISTING_MICRODESC_FETCH.
*/
static const routerstatus_t *
router_pick_directory_server_impl(dirinfo_type_t type, int flags,
@@ -1506,17 +1510,18 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags,
smartlist_free(overloaded_direct);
smartlist_free(overloaded_tunnel);
- if (n_busy_out)
- *n_busy_out = n_busy;
-
if (result == NULL && try_excluding && !options->StrictNodes && n_excluded) {
/* If we got no result, and we are excluding nodes, and StrictNodes is
* not set, try again without excluding nodes. */
try_excluding = 0;
n_excluded = 0;
+ n_busy = 0;
goto retry_without_exclude;
}
+ if (n_busy_out)
+ *n_busy_out = n_busy;
+
return result ? result->rs : NULL;
}