From 934e9c49bb8947ff7ecc07c4da87d6c1836164aa Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sun, 23 Apr 2006 23:09:03 +0000 Subject: [PATCH] Regenerate our local descriptor if it's dirty and some local function asks for it. This may resolve bug 286. svn:r6412 --- src/or/router.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/or/router.c b/src/or/router.c index 16174acdc7..896ff527fa 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -760,8 +760,8 @@ router_get_my_routerinfo(void) if (!server_mode(get_options())) return NULL; - if (!desc_routerinfo) { - if (router_rebuild_descriptor(1)) + if (!desc_routerinfo || !desc_clean_since) { + if (router_rebuild_descriptor(!desc_routerinfo)) return NULL; } return desc_routerinfo; @@ -774,10 +774,8 @@ const char * router_get_my_descriptor(void) { const char *body; - if (!desc_routerinfo) { - if (router_rebuild_descriptor(1)) - return NULL; - } + if (!router_get_my_routerinfo()) + return NULL; body = signed_descriptor_get_body(&desc_routerinfo->cache_info); log_debug(LD_GENERAL,"my desc is '%s'", body); return body;