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

[or-cvs] rebuild directory before uploading



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

Modified Files:
	main.c or.h routers.c 
Log Message:
rebuild directory before uploading

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- main.c	1 Oct 2003 00:43:34 -0000	1.119
+++ main.c	1 Oct 2003 01:08:20 -0000	1.120
@@ -274,7 +274,8 @@
     if(time_to_fetch_directory < now.tv_sec) {
       /* it's time to fetch a new directory and/or post our descriptor */
       if(options.OnionRouter) {
-           router_upload_desc_to_dirservers();
+        router_rebuild_descriptor();
+        router_upload_desc_to_dirservers();
       }
       if(!options.DirPort) {
         /* NOTE directory servers do not currently fetch directories.

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- or.h	1 Oct 2003 00:43:34 -0000	1.151
+++ or.h	1 Oct 2003 01:08:20 -0000	1.152
@@ -694,6 +694,7 @@
                                  crypto_pk_env_t *ident_key);
 const routerinfo_t *router_get_desc_routerinfo(void);
 const char *router_get_my_descriptor(void);
+int router_rebuild_descriptor(void);
 
 /********************************* dirserv.c ***************************/
 int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk);

Index: routers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routers.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- routers.c	1 Oct 2003 00:43:34 -0000	1.65
+++ routers.c	1 Oct 2003 01:08:20 -0000	1.66
@@ -39,7 +39,6 @@
 static int router_add_exit_policy(routerinfo_t *router, 
                                   directory_token_t *tok);
 static int router_resolve_directory(directory_t *dir);
-static int init_descriptor(void);
 
 /****************************************************************************/
 
@@ -1100,7 +1099,7 @@
 static routerinfo_t *desc_routerinfo = NULL; 
 const char *router_get_my_descriptor(void) {
   if (!desc_routerinfo) {
-    if (init_descriptor())
+    if (router_rebuild_descriptor())
       return NULL;
   }
   log_fn(LOG_DEBUG,"my desc is '%s'",descriptor);
@@ -1108,13 +1107,13 @@
 }
 const routerinfo_t *router_get_desc_routerinfo(void) {
   if (!desc_routerinfo) {
-    if (init_descriptor()) 
+    if (router_rebuild_descriptor()) 
       return NULL;
   }
   return desc_routerinfo;
 }
 
-static int init_descriptor(void) {
+int router_rebuild_descriptor(void) {
   routerinfo_t *ri;
   char localhostname[256];
   char *address = options.Address;