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
Benjamin J. Thompson
Tor
Commits
4f3827f1
Commit
4f3827f1
authored
18 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
resolve the entryguard uptime/capacity question. and mark a
new xxx that we'll want to address one day. svn:r8628
parent
e63211fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/or/circuitbuild.c
+12
-8
12 additions, 8 deletions
src/or/circuitbuild.c
with
12 additions
and
8 deletions
src/or/circuitbuild.c
+
12
−
8
View file @
4f3827f1
...
@@ -1842,6 +1842,8 @@ entry_is_time_to_retry(entry_guard_t *e, time_t now)
...
@@ -1842,6 +1842,8 @@ entry_is_time_to_retry(entry_guard_t *e, time_t now)
* - Present in the routerlist;
* - Present in the routerlist;
* - Listed as 'stable' or 'fast' by the current dirserver concensus,
* - Listed as 'stable' or 'fast' by the current dirserver concensus,
* if demanded by <b>need_uptime</b> or <b>need_capacity</b>;
* if demanded by <b>need_uptime</b> or <b>need_capacity</b>;
* (This check is currently redundant with the Guard flag, but in
* the future that might change. Best to leave it in for now.)
* - Allowed by our current ReachableAddresses config option; and
* - Allowed by our current ReachableAddresses config option; and
* - Currently thought to be reachable by us (unless assume_reachable
* - Currently thought to be reachable by us (unless assume_reachable
* is true).
* is true).
...
@@ -1859,7 +1861,6 @@ entry_is_live(entry_guard_t *e, int need_uptime, int need_capacity,
...
@@ -1859,7 +1861,6 @@ entry_is_live(entry_guard_t *e, int need_uptime, int need_capacity,
r
=
router_get_by_digest
(
e
->
identity
);
r
=
router_get_by_digest
(
e
->
identity
);
if
(
!
r
)
if
(
!
r
)
return
NULL
;
return
NULL
;
/* Remove this check -- it seems redundant wrt the Guard flag? XXXX NM */
if
(
router_is_unreliable
(
r
,
need_uptime
,
need_capacity
,
0
))
if
(
router_is_unreliable
(
r
,
need_uptime
,
need_capacity
,
0
))
return
NULL
;
return
NULL
;
if
(
firewall_is_fascist_or
()
&&
if
(
firewall_is_fascist_or
()
&&
...
@@ -2272,22 +2273,25 @@ choose_random_entry(cpath_build_state_t *state)
...
@@ -2272,22 +2273,25 @@ choose_random_entry(cpath_build_state_t *state)
* using him.
* using him.
* (We might get 2 live-but-crummy entry guards, but so be it.) */
* (We might get 2 live-but-crummy entry guards, but so be it.) */
if
(
smartlist_len
(
live_entry_guards
)
<
2
)
{
if
(
smartlist_len
(
live_entry_guards
)
<
2
)
{
if
(
need_uptime
)
{
need_uptime
=
0
;
/* try without that requirement */
goto
retry
;
}
if
(
!
options
->
StrictEntryNodes
)
{
if
(
!
options
->
StrictEntryNodes
)
{
/* still no? try adding a new entry then */
/* still no? try adding a new entry then */
/* XXX if guard doesn't imply fast and stable, then we need
* to tell add_an_entry_guard below what we want, or it might
* be a long time til we get it. -RD */
r
=
add_an_entry_guard
(
NULL
);
r
=
add_an_entry_guard
(
NULL
);
if
(
r
)
{
if
(
r
)
{
smartlist_add
(
live_entry_guards
,
r
);
smartlist_add
(
live_entry_guards
,
r
);
entry_guards_changed
();
entry_guards_changed
();
}
}
}
}
if
(
!
r
&&
need_uptime
)
{
need_uptime
=
0
;
/* try without that requirement */
goto
retry
;
}
if
(
!
r
&&
need_capacity
)
{
if
(
!
r
&&
need_capacity
)
{
/* still no? last attempt, try without requiring capacity */
/* still no? last attempt, try without requiring capacity */
need_capacity
=
0
;
need_capacity
=
0
;
goto
retry
;
goto
retry
;
}
}
/* live_entry_guards will be empty below. Oh well, we tried. */
/* live_entry_guards will be empty below. Oh well, we tried. */
}
}
...
...
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