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

[or-cvs] make router_get_by_nickname consider this router.



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv27357/src/or

Modified Files:
	or.h router.c routerlist.c 
Log Message:
make router_get_by_nickname consider this router.

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.299
retrieving revision 1.300
diff -u -d -r1.299 -r1.300
--- or.h	5 Apr 2004 20:53:49 -0000	1.299
+++ or.h	5 Apr 2004 22:22:42 -0000	1.300
@@ -977,6 +977,7 @@
 void router_upload_dir_desc_to_dirservers(void);
 void router_post_to_dirservers(uint8_t purpose, const char *payload, int payload_len);
 int router_compare_to_my_exit_policy(connection_t *conn);
+routerinfo_t *router_get_my_routerinfo(void);
 const char *router_get_my_descriptor(void);
 int router_rebuild_descriptor(void);
 int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/src/or/router.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- router.c	3 Apr 2004 02:40:30 -0000	1.20
+++ router.c	5 Apr 2004 22:22:42 -0000	1.21
@@ -320,6 +320,18 @@
 
 }
 
+routerinfo_t *router_get_my_routerinfo(void)
+{
+  if (!options.ORPort)
+    return NULL;
+
+  if (!desc_routerinfo) {
+    if (router_rebuild_descriptor())
+      return NULL;
+  }
+  return desc_routerinfo;
+}
+
 const char *router_get_my_descriptor(void) {
   if (!desc_routerinfo) {
     if (router_rebuild_descriptor())

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -d -r1.51 -r1.52
--- routerlist.c	5 Apr 2004 00:47:48 -0000	1.51
+++ routerlist.c	5 Apr 2004 22:22:42 -0000	1.52
@@ -314,6 +314,10 @@
     if (0 == strcmp(router->nickname, nickname))
       return router;
   }
+  router = router_get_my_routerinfo();
+  if (router && 0 == strcmp(router->nickname, nickname))
+    return router;
+
   return NULL;
 }