aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-15 05:41:30 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-15 05:41:30 +0000
commitb70c229f6e371d18a459429dded31053c4f0686d (patch)
tree61a7671a9c6d3654f9840d44f9f4c25ecba16d98
parent3dcc4630b96020d9650ac2fd45e4b508653d2d78 (diff)
downloadtor-b70c229f6e371d18a459429dded31053c4f0686d.tar
tor-b70c229f6e371d18a459429dded31053c4f0686d.tar.gz
make some functions static; clean dead networkstatus entries more often.
svn:r5072
-rw-r--r--src/or/main.c1
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/routerlist.c9
3 files changed, 7 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index dd1682277..801b80da8 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -682,6 +682,7 @@ run_scheduled_events(time_t now)
if (time_to_fetch_directory < now) {
/* purge obsolete entries */
routerlist_remove_old_routers(ROUTER_MAX_AGE);
+ networkstatus_list_clean(now);
if (authdir_mode(options)) {
if (!we_are_hibernating()) { /* try to determine reachability */
diff --git a/src/or/or.h b/src/or/or.h
index a25be01b6..a55405767 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2089,6 +2089,7 @@ void routerlist_free_all(void);
routerinfo_t *routerinfo_copy(const routerinfo_t *router);
void router_mark_as_down(const char *digest);
void routerlist_remove_old_routers(int age);
+void networkstatus_list_clean(time_t now);
int router_add_to_routerlist(routerinfo_t *router, const char **msg,
int from_cache);
int router_load_single_router(const char *s, const char **msg);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 4759da295..6b4295d4c 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -88,6 +88,7 @@ router_reload_networkstatus(void)
tor_free(s);
}
});
+ networkstatus_list_clean(time(NULL));
routers_update_all_from_networkstatus();
return 0;
}
@@ -122,7 +123,7 @@ router_should_rebuild_store(void)
/** Add the <b>len</b>-type router descriptor in <b>s</b> to the router
* journal. */
-int
+static int
router_append_to_journal(const char *s, size_t len)
{
or_options_t *options = get_options();
@@ -150,7 +151,7 @@ router_append_to_journal(const char *s, size_t len)
* replace the router store with the routers currently in our routerlist, and
* clear the journal. Return 0 on success, -1 on failure.
*/
-int
+static int
router_rebuild_store(int force)
{
size_t len = 0;
@@ -1595,7 +1596,7 @@ _compare_digest_to_routerstatus_entry(const void *_key, const void **_member)
/** Return the entry in <b>ns</b> for the identity digest <b>digest</b>, or
* NULL if none was found. */
-routerstatus_t *
+static routerstatus_t *
networkstatus_find_entry(networkstatus_t *ns, const char *digest)
{
return smartlist_bsearch(ns->entries, digest,
@@ -2339,7 +2340,7 @@ routers_update_status_from_networkstatus(smartlist_t *routers)
* published more recently, or it it is listed in the network-status but not
* in the router list.
*/
-smartlist_t *
+static smartlist_t *
router_list_downloadable(void)
{
smartlist_t *superseded = smartlist_create();