From a6520ed5379aa7cd29900eac11c483787f13d4df Mon Sep 17 00:00:00 2001 From: rl1987 Date: Tue, 11 Nov 2014 20:56:40 +0200 Subject: [PATCH] Renaming ROUTER_WAS_NOT_NEW to ROUTER_IS_ALREADY_KNOWN. --- src/or/dirserv.c | 6 +++--- src/or/or.h | 2 +- src/or/routerlist.c | 4 ++-- src/or/routerlist.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 730f005a96..d31bb72361 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -512,7 +512,7 @@ dirserv_add_multiple_descriptors(const char *desc, uint8_t purpose, if (!n_parsed) { *msg = "No descriptors found in your POST."; if (WRA_WAS_ADDED(r)) - r = ROUTER_WAS_NOT_NEW; + r = ROUTER_IS_ALREADY_KNOWN; } else { *msg = "(no message)"; } @@ -574,7 +574,7 @@ dirserv_add_descriptor(routerinfo_t *ri, const char **msg, const char *source) ri->cache_info.signed_descriptor_body, ri->cache_info.signed_descriptor_len, *msg); routerinfo_free(ri); - return ROUTER_WAS_NOT_NEW; + return ROUTER_IS_ALREADY_KNOWN; } /* Make a copy of desc, since router_add_to_routerlist might free @@ -646,7 +646,7 @@ dirserv_add_extrainfo(extrainfo_t *ei, const char **msg) if ((r = routerinfo_incompatible_with_extrainfo(ri, ei, NULL, msg))) { extrainfo_free(ei); - return r < 0 ? ROUTER_WAS_NOT_NEW : ROUTER_BAD_EI; + return r < 0 ? ROUTER_IS_ALREADY_KNOWN : ROUTER_BAD_EI; } router_add_extrainfo_to_routerlist(ei, msg, 0, 0); return ROUTER_ADDED_SUCCESSFULLY; diff --git a/src/or/or.h b/src/or/or.h index 371ca4f47c..a6c7f6666b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -5008,7 +5008,7 @@ typedef enum was_router_added_t { * it was incompatible with its extrainfo document. */ ROUTER_BAD_EI = -1, /* Router descriptor was rejected because it is already known. */ - ROUTER_WAS_NOT_NEW = -2, + ROUTER_IS_ALREADY_KNOWN = -2, /* General purpose router was rejected, because it was not listed * in consensus. */ ROUTER_NOT_IN_CONSENSUS = -3, diff --git a/src/or/routerlist.c b/src/or/routerlist.c index d81dae4676..81c3717c92 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -3376,7 +3376,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, router_describe(router)); *msg = "Router descriptor was not new."; routerinfo_free(router); - return ROUTER_WAS_NOT_NEW; + return ROUTER_IS_ALREADY_KNOWN; } } @@ -3461,7 +3461,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg, &routerlist->desc_store); routerlist_insert_old(routerlist, router); *msg = "Router descriptor was not new."; - return ROUTER_WAS_NOT_NEW; + return ROUTER_IS_ALREADY_KNOWN; } else { /* Same key, and either new, or listed in the consensus. */ log_debug(LD_DIR, "Replacing entry for router %s", diff --git a/src/or/routerlist.h b/src/or/routerlist.h index c6151deb49..e73e69b63a 100644 --- a/src/or/routerlist.h +++ b/src/or/routerlist.h @@ -118,7 +118,7 @@ WRA_WAS_ADDED(was_router_added_t s) { static INLINE int WRA_WAS_OUTDATED(was_router_added_t s) { return (s == ROUTER_WAS_TOO_OLD || - s == ROUTER_WAS_NOT_NEW || + s == ROUTER_IS_ALREADY_KNOWN || s == ROUTER_NOT_IN_CONSENSUS || s == ROUTER_NOT_IN_CONSENSUS_OR_NETWORKSTATUS); }