[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] make some functions static; clean dead networkstatus entrie...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv22732/src/or

Modified Files:
	main.c or.h routerlist.c 
Log Message:
make some functions static; clean dead networkstatus entries more often.

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.552
retrieving revision 1.553
diff -u -d -r1.552 -r1.553
--- main.c	15 Sep 2005 05:19:38 -0000	1.552
+++ main.c	15 Sep 2005 05:41:30 -0000	1.553
@@ -682,6 +682,7 @@
   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 */

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.685
retrieving revision 1.686
diff -u -d -r1.685 -r1.686
--- or.h	15 Sep 2005 05:19:38 -0000	1.685
+++ or.h	15 Sep 2005 05:41:30 -0000	1.686
@@ -2089,6 +2089,7 @@
 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);

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.292
retrieving revision 1.293
diff -u -d -r1.292 -r1.293
--- routerlist.c	15 Sep 2005 05:19:38 -0000	1.292
+++ routerlist.c	15 Sep 2005 05:41:30 -0000	1.293
@@ -88,6 +88,7 @@
         tor_free(s);
       }
     });
+  networkstatus_list_clean(time(NULL));
   routers_update_all_from_networkstatus();
   return 0;
 }
@@ -122,7 +123,7 @@
 
 /** 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 @@
  * 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 @@
 
 /** 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 @@
  * 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();