mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-23 14:40:51 +01:00
rebuild directory before uploading
svn:r528
This commit is contained in:
parent
df5c7534b1
commit
91cf86d8da
3 changed files with 6 additions and 5 deletions
|
@ -274,7 +274,8 @@ static int prepare_for_poll(void) {
|
||||||
if(time_to_fetch_directory < now.tv_sec) {
|
if(time_to_fetch_directory < now.tv_sec) {
|
||||||
/* it's time to fetch a new directory and/or post our descriptor */
|
/* it's time to fetch a new directory and/or post our descriptor */
|
||||||
if(options.OnionRouter) {
|
if(options.OnionRouter) {
|
||||||
router_upload_desc_to_dirservers();
|
router_rebuild_descriptor();
|
||||||
|
router_upload_desc_to_dirservers();
|
||||||
}
|
}
|
||||||
if(!options.DirPort) {
|
if(!options.DirPort) {
|
||||||
/* NOTE directory servers do not currently fetch directories.
|
/* NOTE directory servers do not currently fetch directories.
|
||||||
|
|
|
@ -694,6 +694,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
|
||||||
crypto_pk_env_t *ident_key);
|
crypto_pk_env_t *ident_key);
|
||||||
const routerinfo_t *router_get_desc_routerinfo(void);
|
const routerinfo_t *router_get_desc_routerinfo(void);
|
||||||
const char *router_get_my_descriptor(void);
|
const char *router_get_my_descriptor(void);
|
||||||
|
int router_rebuild_descriptor(void);
|
||||||
|
|
||||||
/********************************* dirserv.c ***************************/
|
/********************************* dirserv.c ***************************/
|
||||||
int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk);
|
int dirserv_add_own_fingerprint(const char *nickname, crypto_pk_env_t *pk);
|
||||||
|
|
|
@ -39,7 +39,6 @@ static void router_free_exit_policy(routerinfo_t *router);
|
||||||
static int router_add_exit_policy(routerinfo_t *router,
|
static int router_add_exit_policy(routerinfo_t *router,
|
||||||
directory_token_t *tok);
|
directory_token_t *tok);
|
||||||
static int router_resolve_directory(directory_t *dir);
|
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;
|
static routerinfo_t *desc_routerinfo = NULL;
|
||||||
const char *router_get_my_descriptor(void) {
|
const char *router_get_my_descriptor(void) {
|
||||||
if (!desc_routerinfo) {
|
if (!desc_routerinfo) {
|
||||||
if (init_descriptor())
|
if (router_rebuild_descriptor())
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
log_fn(LOG_DEBUG,"my desc is '%s'",descriptor);
|
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) {
|
const routerinfo_t *router_get_desc_routerinfo(void) {
|
||||||
if (!desc_routerinfo) {
|
if (!desc_routerinfo) {
|
||||||
if (init_descriptor())
|
if (router_rebuild_descriptor())
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return desc_routerinfo;
|
return desc_routerinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_descriptor(void) {
|
int router_rebuild_descriptor(void) {
|
||||||
routerinfo_t *ri;
|
routerinfo_t *ri;
|
||||||
char localhostname[256];
|
char localhostname[256];
|
||||||
char *address = options.Address;
|
char *address = options.Address;
|
||||||
|
|
Loading…
Add table
Reference in a new issue