aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2003-10-01 01:08:20 +0000
committerNick Mathewson <nickm@torproject.org>2003-10-01 01:08:20 +0000
commit91cf86d8da10b4b325d2c884a737f5c079244751 (patch)
tree250f95c7c0f90b6c4ea95872f920c80a99824aea /src
parentdf5c7534b1c127d799da43a96307c76282d5e348 (diff)
downloadtor-91cf86d8da10b4b325d2c884a737f5c079244751.tar
tor-91cf86d8da10b4b325d2c884a737f5c079244751.tar.gz
rebuild directory before uploading
svn:r528
Diffstat (limited to 'src')
-rw-r--r--src/or/main.c3
-rw-r--r--src/or/or.h1
-rw-r--r--src/or/routers.c7
3 files changed, 6 insertions, 5 deletions
diff --git a/src/or/main.c b/src/or/main.c
index befcc893d..eabb6d271 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -274,7 +274,8 @@ static int prepare_for_poll(void) {
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.
diff --git a/src/or/or.h b/src/or/or.h
index b739eadcd..94023e26f 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -694,6 +694,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
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);
diff --git a/src/or/routers.c b/src/or/routers.c
index 9d82e3f47..58fda456f 100644
--- a/src/or/routers.c
+++ b/src/or/routers.c
@@ -39,7 +39,6 @@ static void router_free_exit_policy(routerinfo_t *router);
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 char descriptor[8192];
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 char *router_get_my_descriptor(void) {
}
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;