[or-cvs] Never list unapproved servers as recommended
Nick Mathewson
nickm at seul.org
Wed May 5 04:55:03 UTC 2004
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv13632/src/or
Modified Files:
dirserv.c
Log Message:
Never list unapproved servers as recommended
Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/src/or/dirserv.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -d -r1.42 -r1.43
--- dirserv.c 5 May 2004 00:30:43 -0000 1.42
+++ dirserv.c 5 May 2004 04:55:00 -0000 1.43
@@ -166,6 +166,20 @@
}
}
+/* Return true iff any router named 'nickname' is in the fingerprint
+ * list. */
+static int
+router_nickname_is_approved(const char *nickname)
+{
+ int i;
+ for (i=0;i<n_fingerprints;++i) {
+ if (!strcasecmp(nickname,fingerprint_list[i].nickname)) {
+ return 1;
+ }
+ }
+ return 0;
+}
+
/* Clear the current fingerprint list. */
void
dirserv_free_fingerprint_list()
@@ -406,10 +420,8 @@
continue; /* only list successfully handshaked OR's. */
if(!conn->nickname) /* it's an OP, don't list it */
continue;
- /* XXX if conn->nickname not approved, continue. otherwise when you
- * remove them from the approved list and hup, their descriptor is
- * taken out of the directory, but they're still in the running-routers
- * line. */
+ if (!router_nickname_is_approved(conn->nickname))
+ continue; /* If we removed them from the approved list, don't list it.*/
nickname_lst[n++] = conn->nickname;
}
length = n + 1; /* spaces + EOS + 1. */
More information about the tor-commits
mailing list