mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Consider all routerinfo errors other than "not a server" transient
This commit is contained in:
parent
7787150521
commit
9c242e950b
@ -164,22 +164,12 @@ routerinfo_err_to_string(int err)
|
|||||||
int
|
int
|
||||||
routerinfo_err_is_transient(int err)
|
routerinfo_err_is_transient(int err)
|
||||||
{
|
{
|
||||||
switch (err) {
|
/**
|
||||||
case TOR_ROUTERINFO_ERROR_NO_EXT_ADDR:
|
* For simplicity, we consider all errors other than
|
||||||
return 1;
|
* "not a server" transient - see discussion on
|
||||||
case TOR_ROUTERINFO_ERROR_CANNOT_PARSE:
|
* https://trac.torproject.org/projects/tor/ticket/27034
|
||||||
return 1;
|
*/
|
||||||
case TOR_ROUTERINFO_ERROR_NOT_A_SERVER:
|
return err != TOR_ROUTERINFO_ERROR_NOT_A_SERVER;
|
||||||
return 0;
|
|
||||||
case TOR_ROUTERINFO_ERROR_DIGEST_FAILED:
|
|
||||||
return 0; // XXX: bug?
|
|
||||||
case TOR_ROUTERINFO_ERROR_CANNOT_GENERATE:
|
|
||||||
return 1;
|
|
||||||
case TOR_ROUTERINFO_ERROR_DESC_REBUILDING:
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Replace the current onion key with <b>k</b>. Does not affect
|
/** Replace the current onion key with <b>k</b>. Does not affect
|
||||||
|
@ -1706,7 +1706,7 @@ test_policies_getinfo_helper_policies(void *arg)
|
|||||||
rv = getinfo_helper_policies(NULL, "exit-policy/full", &answer,
|
rv = getinfo_helper_policies(NULL, "exit-policy/full", &answer,
|
||||||
&errmsg);
|
&errmsg);
|
||||||
|
|
||||||
tt_int_op(rv, OP_EQ, 0);
|
tt_int_op(rv, OP_EQ, -1);
|
||||||
tt_ptr_op(answer, OP_EQ, NULL);
|
tt_ptr_op(answer, OP_EQ, NULL);
|
||||||
tt_ptr_op(errmsg, OP_NE, NULL);
|
tt_ptr_op(errmsg, OP_NE, NULL);
|
||||||
tt_str_op(errmsg, OP_EQ, "Key digest failed");
|
tt_str_op(errmsg, OP_EQ, "Key digest failed");
|
||||||
|
Loading…
Reference in New Issue
Block a user