mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
if connecting to an OR fails immediately, mark it as down
svn:r2029
This commit is contained in:
@@ -829,7 +829,9 @@ int connection_handle_write(connection_t *conn) {
|
||||
log_fn(LOG_DEBUG,"in-progress connect failed. Removing.");
|
||||
connection_close_immediate(conn);
|
||||
connection_mark_for_close(conn);
|
||||
/* Previously we tested conn->nickname; is this right? */
|
||||
/* it's safe to pass OPs to router_mark_as_down(), since it just
|
||||
* ignores unrecognized routers
|
||||
*/
|
||||
if (conn->type == CONN_TYPE_OR)
|
||||
router_mark_as_down(conn->identity_digest);
|
||||
return -1;
|
||||
|
||||
@@ -177,6 +177,7 @@ connection_t *connection_or_connect(uint32_t addr, uint16_t port,
|
||||
|
||||
switch(connection_connect(conn, conn->address, addr, port)) {
|
||||
case -1:
|
||||
router_mark_as_down(conn->identity_digest);
|
||||
connection_free(conn);
|
||||
return NULL;
|
||||
case 0:
|
||||
|
||||
@@ -354,7 +354,7 @@ void routerlist_free(routerlist_t *rl)
|
||||
tor_free(rl);
|
||||
}
|
||||
|
||||
/** Mark the router named <b>nickname</b> as non-running in our routerlist. */
|
||||
/** Mark the router with ID <b>digest</b> as non-running in our routerlist. */
|
||||
void router_mark_as_down(const char *digest) {
|
||||
routerinfo_t *router;
|
||||
tor_assert(digest);
|
||||
|
||||
Reference in New Issue
Block a user