Renaming ROUTER_WAS_NOT_NEW to ROUTER_IS_ALREADY_KNOWN.

This commit is contained in:
rl1987 2014-11-11 20:56:40 +02:00
parent f9d73eea9c
commit a6520ed537
4 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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,

View File

@ -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",

View File

@ -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);
}