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

[or-cvs] Don"t warn about being unverified if you"re not in the runn...



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	or.h routerlist.c routerparse.c 
Log Message:
Don't warn about being unverified if you're not in the running-routers
list at all.


Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.399
retrieving revision 1.400
diff -u -d -r1.399 -r1.400
--- or.h	7 Aug 2004 03:03:23 -0000	1.399
+++ or.h	7 Aug 2004 09:01:56 -0000	1.400
@@ -1400,9 +1400,9 @@
 void running_routers_free(running_routers_t *rr);
 void routerlist_update_from_runningrouters(routerlist_t *list,
                                            running_routers_t *rr);
-void router_update_status_from_smartlist(routerinfo_t *r,
-                                         time_t list_time,
-                                         smartlist_t *running_list);
+int router_update_status_from_smartlist(routerinfo_t *r,
+                                        time_t list_time,
+                                        smartlist_t *running_list);
 
 /********************************* routerparse.c ************************/
 

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -u -d -r1.116 -r1.117
--- routerlist.c	7 Aug 2004 03:38:07 -0000	1.116
+++ routerlist.c	7 Aug 2004 09:01:56 -0000	1.117
@@ -825,10 +825,12 @@
  *     <li> $<b>hexdigest</b> -- router is running and unverified.
  *     <li> !$<b>hexdigest</b> -- router is not-running and unverified.
  * </ol>
+ *
+ * Return 1 if we found router in running_list, else return 0.
  */
-void router_update_status_from_smartlist(routerinfo_t *router,
-                                         time_t list_time,
-                                         smartlist_t *running_list)
+int router_update_status_from_smartlist(routerinfo_t *router,
+                                        time_t list_time,
+                                        smartlist_t *running_list)
 {
   int n_names, i, running, approved;
   const char *name;
@@ -863,7 +865,7 @@
           router->is_running = 1;
         }
         router->is_verified = (name[0] != '$');
-        return;
+        return 1;
       }
     } else { /* *name == '!' */
       name++;
@@ -873,10 +875,11 @@
           router->is_running = 0;
         }
         router->is_verified = (name[0] != '$');
-        return;
+        return 1;
       }
     }
   }
+  return 0;
 }
 
 /*

Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerparse.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- routerparse.c	7 Aug 2004 05:12:08 -0000	1.29
+++ routerparse.c	7 Aug 2004 09:01:56 -0000	1.30
@@ -393,7 +393,7 @@
   for (i=0; i<tok->n_args; ++i) {
     smartlist_add(good_nickname_list, tok->args[i]);
   }
-  tok->n_args = 0; /* Don't free the strings in good_nickname_lst yet. */
+  tok->n_args = 0; /* Don't free the strings in good_nickname_list yet. */
 
   /* Read the router list from s, advancing s up past the end of the last
    * router. */
@@ -416,9 +416,9 @@
     static int have_warned_about_unverified_status = 0;
     routerinfo_t *me = router_get_my_routerinfo();
     if(me) {
-      router_update_status_from_smartlist(me, published_on,
-                                          good_nickname_list);
-      if(me->is_verified == 0 && !have_warned_about_unverified_status) {
+      if(router_update_status_from_smartlist(me, published_on,
+                                             good_nickname_list)==1 &&
+        me->is_verified == 0 && !have_warned_about_unverified_status) {
         log_fn(LOG_WARN,"Dirserver %s lists your server as unverified. Please consider sending your identity fingerprint to the tor-ops.", dirnickname);
         have_warned_about_unverified_status = 1;
       }