diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-12-22 04:53:11 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-12-22 04:53:11 +0000 |
commit | 98a376fab1725c81df84a1782b3b625958e4c6ba (patch) | |
tree | 4961240d483831348828a71151f67e75594c8836 /src/or/routerlist.c | |
parent | df22dcb602ff45f32444ba1f882d092996345771 (diff) | |
download | tor-98a376fab1725c81df84a1782b3b625958e4c6ba.tar.gz tor-98a376fab1725c81df84a1782b3b625958e4c6ba.zip |
More propagating of things that need to be was_router_added_t now.
svn:r17721
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 03bce599a8..006713f017 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3069,13 +3069,14 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, * as for router_add_to_routerlist(). Return true iff we actually inserted * it. */ -int +was_router_added_t router_add_extrainfo_to_routerlist(extrainfo_t *ei, const char **msg, int from_cache, int from_fetch) { int inserted; (void)from_fetch; if (msg) *msg = NULL; + /*XXXX021 Do something with msg */ inserted = extrainfo_insert(router_get_routerlist(), ei); @@ -3083,7 +3084,10 @@ router_add_extrainfo_to_routerlist(extrainfo_t *ei, const char **msg, signed_desc_append_to_journal(&ei->cache_info, &routerlist->extrainfo_store); - return inserted; + if (inserted) + return ROUTER_ADDED_SUCCESSFULLY; + else + return ROUTER_BAD_EI; } /** Sorting helper: return <0, 0, or >0 depending on whether the @@ -3528,9 +3532,9 @@ router_load_extrainfo_from_string(const char *s, const char *eos, log_info(LD_DIR, "%d elements to add", smartlist_len(extrainfo_list)); SMARTLIST_FOREACH(extrainfo_list, extrainfo_t *, ei, { - int added = + was_router_added_t added = router_add_extrainfo_to_routerlist(ei, &msg, from_cache, !from_cache); - if (added && requested_fingerprints) { + if (WRA_WAS_ADDED(added) && requested_fingerprints) { char fp[HEX_DIGEST_LEN+1]; base16_encode(fp, sizeof(fp), descriptor_digests ? ei->cache_info.signed_descriptor_digest : |