[or-cvs] Fall back to routerlist instead of descriptor_list when we ...

Nick Mathewson nickm at seul.org
Thu Aug 25 20:54:15 UTC 2005


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

Modified Files:
	dirserv.c 
Log Message:
Fall back to routerlist instead of descriptor_list when we are a cache.

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -d -r1.181 -r1.182
--- dirserv.c	25 Aug 2005 20:45:53 -0000	1.181
+++ dirserv.c	25 Aug 2005 20:54:12 -0000	1.182
@@ -1275,6 +1275,19 @@
 void
 dirserv_get_routerdescs(smartlist_t *descs_out, const char *key)
 {
+  smartlist_t *complete_list;
+
+  /* This is annoying. Can we unify these? */
+  if (descriptor_list)
+    complete_list = descriptor_list;
+  else {
+    routerlist_t *rlst;
+    router_get_routerlist(&rlst);
+    complete_list = rlst->routers;
+  }
+
+  if (!complete_list)
+    return;
 
   if (!strcmp(key, "/tor/server/all")) {
     smartlist_add_all(descs_out, descriptor_list);



More information about the tor-commits mailing list