[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Handle changed router status correctly when reloading finge...
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] Handle changed router status correctly when reloading finge...
- From: nickm@xxxxxxxx (Nick Mathewson)
- Date: Tue, 5 Apr 2005 21:09:29 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Tue, 05 Apr 2005 21:09:50 -0400
- Reply-to: or-dev@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv17185/src/or
Modified Files:
dirserv.c
Log Message:
Handle changed router status correctly when reloading fingerprint file
Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.152
retrieving revision 1.153
diff -u -d -r1.152 -r1.153
--- dirserv.c 6 Apr 2005 00:53:13 -0000 1.152
+++ dirserv.c 6 Apr 2005 01:09:26 -0000 1.153
@@ -428,17 +428,25 @@
directory_remove_unrecognized(void)
{
int i;
+ int r;
routerinfo_t *ent;
if (!descriptor_list)
descriptor_list = smartlist_create();
for (i = 0; i < smartlist_len(descriptor_list); ++i) {
ent = smartlist_get(descriptor_list, i);
- if (dirserv_router_fingerprint_is_known(ent)<=0) {
- log(LOG_INFO, "Router '%s' is no longer recognized",
+ r = dirserv_router_fingerprint_is_known(ent);
+ if (r<0) {
+ log(LOG_INFO, "Router '%s' is now verified with a key; removing old router with same name and different key.",
ent->nickname);
routerinfo_free(ent);
smartlist_del(descriptor_list, i--);
+ } else if (r>0 && !ent->is_verified) {
+ log(LOG_INFO, "Router '%s' is now approved.", ent->nickname);
+ ent->is_verified = 1;
+ } else if (r==0 && ent->is_verified) {
+ log(LOG_INFO, "Router '%s' is no longer approved." ent->nickname);
+ ent->is_verified = 0;
}
}
}