Skip to content
Snippets Groups Projects
Commit 3c2c8ed4 authored by Roger Dingledine's avatar Roger Dingledine
Browse files

0.0.8 ORs should autoconnect to authdirservers and 0.0.7 servers

svn:r2091
parent f82a3650
No related branches found
No related tags found
No related merge requests found
...@@ -353,7 +353,7 @@ void directory_has_arrived(void) { ...@@ -353,7 +353,7 @@ void directory_has_arrived(void) {
has_fetched_directory=1; has_fetched_directory=1;
if(clique_mode()) { /* connect to them all */ if(server_mode()) { /* connect to the appropriate routers */
router_retry_connections(); router_retry_connections();
} }
} }
...@@ -541,7 +541,10 @@ static void run_scheduled_events(time_t now) { ...@@ -541,7 +541,10 @@ static void run_scheduled_events(time_t now) {
if(authdir_mode()) { if(authdir_mode()) {
/* We're a directory; dump any old descriptors. */ /* We're a directory; dump any old descriptors. */
dirserv_remove_old_servers(); dirserv_remove_old_servers();
/* dirservers try to reconnect, in case connections have failed */ }
if(server_mode()) {
/* dirservers try to reconnect, in case connections have failed;
* and normal servers try to reconnect to dirservers */
router_retry_connections(); router_retry_connections();
} }
......
...@@ -347,18 +347,24 @@ int init_keys(void) { ...@@ -347,18 +347,24 @@ int init_keys(void) {
* Clique maintenance * Clique maintenance
*/ */
/** OR only: try to open connections to all of the other ORs we know about. /** OR only: if in clique mode, try to open connections to all of the
* other ORs we know about. Otherwise, open connections to those we
* think are in clique mode.
*/ */
void router_retry_connections(void) { void router_retry_connections(void) {
int i; int i;
routerinfo_t *router; routerinfo_t *router;
routerlist_t *rl; routerlist_t *rl;
tor_assert(server_mode());
router_get_routerlist(&rl); router_get_routerlist(&rl);
for (i=0;i < smartlist_len(rl->routers);i++) { for (i=0;i < smartlist_len(rl->routers);i++) {
router = smartlist_get(rl->routers, i); router = smartlist_get(rl->routers, i);
if(router_is_me(router)) if(router_is_me(router))
continue; continue;
if(!clique_mode() && !router_is_clique_mode(router))
continue;
if(!connection_get_by_identity_digest(router->identity_digest, if(!connection_get_by_identity_digest(router->identity_digest,
CONN_TYPE_OR)) { CONN_TYPE_OR)) {
/* not in the list */ /* not in the list */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment