Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mike Perry
Tor
Commits
1c21a02b
Commit
1c21a02b
authored
20 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
router_choose_random_node() was ignoring its routerlist argument.
so now we don't pass it one. svn:r1911
parent
66dd21b7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/or/circuitbuild.c
+1
-1
1 addition, 1 deletion
src/or/circuitbuild.c
src/or/or.h
+1
-2
1 addition, 2 deletions
src/or/or.h
src/or/rendservice.c
+1
-4
1 addition, 4 deletions
src/or/rendservice.c
src/or/routerlist.c
+2
-3
2 additions, 3 deletions
src/or/routerlist.c
with
5 additions
and
10 deletions
src/or/circuitbuild.c
+
1
−
1
View file @
1c21a02b
...
...
@@ -855,7 +855,7 @@ static routerinfo_t *choose_good_exit_server(uint8_t purpose, routerlist_t *dir)
case
CIRCUIT_PURPOSE_C_GENERAL
:
return
choose_good_exit_server_general
(
dir
);
case
CIRCUIT_PURPOSE_C_ESTABLISH_REND
:
r
=
router_choose_random_node
(
dir
,
options
.
RendNodes
,
options
.
RendExcludeNodes
,
NULL
);
r
=
router_choose_random_node
(
options
.
RendNodes
,
options
.
RendExcludeNodes
,
NULL
);
return
r
;
default:
log_fn
(
LOG_WARN
,
"unhandled purpose %d"
,
purpose
);
...
...
This diff is collapsed.
Click to expand it.
src/or/or.h
+
1
−
2
View file @
1c21a02b
...
...
@@ -1292,8 +1292,7 @@ routerinfo_t *router_pick_directory_server(void);
struct
smartlist_t
;
void
add_nickname_list_to_smartlist
(
struct
smartlist_t
*
sl
,
const
char
*
list
);
void
router_add_running_routers_to_smartlist
(
struct
smartlist_t
*
sl
);
routerinfo_t
*
router_choose_random_node
(
routerlist_t
*
dir
,
char
*
preferred
,
char
*
excluded
,
routerinfo_t
*
router_choose_random_node
(
char
*
preferred
,
char
*
excluded
,
struct
smartlist_t
*
excludedsmartlist
);
routerinfo_t
*
router_get_by_addr_port
(
uint32_t
addr
,
uint16_t
port
);
routerinfo_t
*
router_get_by_nickname
(
char
*
nickname
);
...
...
This diff is collapsed.
Click to expand it.
src/or/rendservice.c
+
1
−
4
View file @
1c21a02b
...
...
@@ -772,14 +772,12 @@ upload_service_descriptor(rend_service_t *service)
void
rend_services_introduce
(
void
)
{
int
i
,
j
,
r
;
routerinfo_t
*
router
;
routerlist_t
*
rl
;
rend_service_t
*
service
;
char
*
intro
;
int
changed
,
prev_intro_nodes
;
smartlist_t
*
intro_routers
,
*
exclude_routers
;
time_t
now
;
router_get_routerlist
(
&
rl
);
intro_routers
=
smartlist_create
();
exclude_routers
=
smartlist_create
();
now
=
time
(
NULL
);
...
...
@@ -830,8 +828,7 @@ void rend_services_introduce(void) {
smartlist_add_all
(
exclude_routers
,
intro_routers
);
/* The directory is now here. Pick three ORs as intro points. */
for
(
j
=
prev_intro_nodes
;
j
<
NUM_INTRO_POINTS
;
++
j
)
{
router
=
router_choose_random_node
(
rl
,
service
->
intro_prefer_nodes
,
router
=
router_choose_random_node
(
service
->
intro_prefer_nodes
,
service
->
intro_exclude_nodes
,
exclude_routers
);
if
(
!
router
)
{
...
...
This diff is collapsed.
Click to expand it.
src/or/routerlist.c
+
2
−
3
View file @
1c21a02b
...
...
@@ -149,13 +149,12 @@ void router_add_running_routers_to_smartlist(smartlist_t *sl) {
}
}
/**
Pick
a random running router from
a
routerlist
<b>dir</b>
. If any node
/**
Return
a random running router from
the
routerlist. If any node
* named in <b>preferred</b> is available, pick one of those. Never pick a
* node named in <b>excluded</b>, or whose routerinfo is in
* <b>excludedsmartlist</b>, even if they are the only nodes available.
*/
routerinfo_t
*
router_choose_random_node
(
routerlist_t
*
dir
,
char
*
preferred
,
char
*
excluded
,
routerinfo_t
*
router_choose_random_node
(
char
*
preferred
,
char
*
excluded
,
smartlist_t
*
excludedsmartlist
)
{
smartlist_t
*
sl
,
*
excludednodes
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment