[or-cvs] r13270: avoid calling smartlist_get(..., -1) if we have a consensus (tor/trunk/src/or)

arma at seul.org arma at seul.org
Fri Jan 25 07:11:32 UTC 2008


Author: arma
Date: 2008-01-25 02:11:32 -0500 (Fri, 25 Jan 2008)
New Revision: 13270

Modified:
   tor/trunk/src/or/routerlist.c
Log:
avoid calling smartlist_get(..., -1) if we have a consensus but no
hsdir nodes.


Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2008-01-25 06:47:46 UTC (rev 13269)
+++ tor/trunk/src/or/routerlist.c	2008-01-25 07:11:32 UTC (rev 13270)
@@ -4505,7 +4505,8 @@
     return 0; /* This is redundant, but let's be paranoid. */
   my_id = me->cache_info.identity_digest;
   responsible = smartlist_create();
-  if (hid_serv_get_responsible_directories(responsible, query)<0) {
+  (int) hid_serv_get_responsible_directories(responsible, query);
+  if (!smartlist_len(responsible)) {
     smartlist_free(responsible);
     return 0;
   }



More information about the tor-commits mailing list