Loading src/or/onion.c +16 −3 Original line number Diff line number Diff line Loading @@ -247,7 +247,7 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) int best_support_idx = -1; int best_maybe_support_idx = -1; int n_best_support=0, n_best_maybe_support=0; smartlist_t *sl; smartlist_t *sl, *preferredexits; routerinfo_t *router; get_connection_array(&carray, &n_connections); Loading Loading @@ -335,6 +335,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) "pending connections, and %d that might support %d/%d.", n_best_support, best_support, n_pending_connections, n_best_maybe_support, best_maybe_support, n_pending_connections); preferredexits = smartlist_create(MAX_ROUTERS_IN_DIR); add_nickname_list_to_smartlist(preferredexits,options.ExitNodes); /* If any routers definitely support any pending connections, choose one * at random. */ if (best_support > 0) { Loading @@ -343,7 +347,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) if (n_supported[i] == best_support) smartlist_add(sl, dir->routers[i]); if (smartlist_overlap(sl,preferredexits)) smartlist_intersect(sl,preferredexits); router = smartlist_choose(sl); smartlist_free(preferredexits); smartlist_free(sl); tor_free(n_supported); tor_free(n_maybe_supported); log_fn(LOG_DEBUG, "Chose exit server '%s'", router->nickname); Loading @@ -358,7 +365,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) if(n_maybe_supported[i] == best_maybe_support) smartlist_add(sl, dir->routers[i]); if (smartlist_overlap(sl,preferredexits)) smartlist_intersect(sl,preferredexits); router = smartlist_choose(sl); smartlist_free(preferredexits); smartlist_free(sl); tor_free(n_supported); tor_free(n_maybe_supported); log_fn(LOG_DEBUG, "Chose exit server '%s'", router->nickname); Loading @@ -372,7 +382,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) if(n_supported[i] != -1) smartlist_add(sl, dir->routers[i]); if (smartlist_overlap(sl,preferredexits)) smartlist_intersect(sl,preferredexits); router = smartlist_choose(sl); smartlist_free(preferredexits); smartlist_free(sl); if(router) { tor_free(n_supported); tor_free(n_maybe_supported); Loading Loading
src/or/onion.c +16 −3 Original line number Diff line number Diff line Loading @@ -247,7 +247,7 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) int best_support_idx = -1; int best_maybe_support_idx = -1; int n_best_support=0, n_best_maybe_support=0; smartlist_t *sl; smartlist_t *sl, *preferredexits; routerinfo_t *router; get_connection_array(&carray, &n_connections); Loading Loading @@ -335,6 +335,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) "pending connections, and %d that might support %d/%d.", n_best_support, best_support, n_pending_connections, n_best_maybe_support, best_maybe_support, n_pending_connections); preferredexits = smartlist_create(MAX_ROUTERS_IN_DIR); add_nickname_list_to_smartlist(preferredexits,options.ExitNodes); /* If any routers definitely support any pending connections, choose one * at random. */ if (best_support > 0) { Loading @@ -343,7 +347,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) if (n_supported[i] == best_support) smartlist_add(sl, dir->routers[i]); if (smartlist_overlap(sl,preferredexits)) smartlist_intersect(sl,preferredexits); router = smartlist_choose(sl); smartlist_free(preferredexits); smartlist_free(sl); tor_free(n_supported); tor_free(n_maybe_supported); log_fn(LOG_DEBUG, "Chose exit server '%s'", router->nickname); Loading @@ -358,7 +365,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) if(n_maybe_supported[i] == best_maybe_support) smartlist_add(sl, dir->routers[i]); if (smartlist_overlap(sl,preferredexits)) smartlist_intersect(sl,preferredexits); router = smartlist_choose(sl); smartlist_free(preferredexits); smartlist_free(sl); tor_free(n_supported); tor_free(n_maybe_supported); log_fn(LOG_DEBUG, "Chose exit server '%s'", router->nickname); Loading @@ -372,7 +382,10 @@ static routerinfo_t *choose_good_exit_server(routerlist_t *dir) if(n_supported[i] != -1) smartlist_add(sl, dir->routers[i]); if (smartlist_overlap(sl,preferredexits)) smartlist_intersect(sl,preferredexits); router = smartlist_choose(sl); smartlist_free(preferredexits); smartlist_free(sl); if(router) { tor_free(n_supported); tor_free(n_maybe_supported); Loading