diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-05-22 15:49:14 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-05-22 15:49:14 +0000 |
commit | 6975a093e965e73ee88efe70b79a2211b9f5d7d3 (patch) | |
tree | a71662257de43d57a577da4c2aa2ef777941329c /src/or/routerlist.c | |
parent | e935d73b34094a88dbd997769be1c52b633fc3d3 (diff) | |
download | tor-6975a093e965e73ee88efe70b79a2211b9f5d7d3.tar.gz tor-6975a093e965e73ee88efe70b79a2211b9f5d7d3.zip |
r12853@catbus: nickm | 2007-05-22 11:36:54 -0400
Make connection_array into a smartlist.
svn:r10292
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index c5c7c21abd..d09bd7f234 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -4169,17 +4169,15 @@ list_pending_descriptor_downloads(digestmap_t *result, int extrainfo) { const char *prefix = "d/"; size_t p_len = strlen(prefix); - int i, n_conns; - connection_t **carray; smartlist_t *tmp = smartlist_create(); int purpose = extrainfo ? DIR_PURPOSE_FETCH_EXTRAINFO : DIR_PURPOSE_FETCH_SERVERDESC; + smartlist_t *conns = get_connection_array(); tor_assert(result); - get_connection_array(&carray, &n_conns); - for (i = 0; i < n_conns; ++i) { - connection_t *conn = carray[i]; + SMARTLIST_FOREACH(conns, connection_t *, conn, + { if (conn->type == CONN_TYPE_DIR && conn->purpose == purpose && !conn->marked_for_close) { @@ -4188,7 +4186,7 @@ list_pending_descriptor_downloads(digestmap_t *result, int extrainfo) dir_split_resource_into_fingerprints(resource + p_len, tmp, NULL, 1, 0); } - } + }); SMARTLIST_FOREACH(tmp, char *, d, { digestmap_set(result, d, (void*)1); |