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

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



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);