Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
The Tor Project
Core
Tor
Commits
c5052bec
Commit
c5052bec
authored
20 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
normal circs are 3 hops, but rend/intro circs are 4, because
the initiator doesn't get to choose the last hop svn:r1595
parent
fc5a7662
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/onion.c
+12
-3
12 additions, 3 deletions
src/or/onion.c
with
12 additions
and
3 deletions
src/or/onion.c
+
12
−
3
View file @
c5052bec
...
...
@@ -160,7 +160,7 @@ int onionskin_answer(circuit_t *circ, unsigned char *payload, unsigned char *key
extern
int
has_fetched_directory
;
static
int
new_route_len
(
double
cw
,
smartlist_t
*
routers
)
{
static
int
new_route_len
(
double
cw
,
uint8_t
purpose
,
smartlist_t
*
routers
)
{
int
num_acceptable_routers
;
int
routelen
;
...
...
@@ -169,7 +169,16 @@ static int new_route_len(double cw, smartlist_t *routers) {
#ifdef TOR_PERF
routelen
=
2
;
#else
routelen
=
3
;
if
(
purpose
==
CIRCUIT_PURPOSE_C_GENERAL
)
routelen
=
3
;
else
if
(
purpose
==
CIRCUIT_PURPOSE_C_ESTABLISH_REND
)
routelen
=
4
;
else
if
(
purpose
==
CIRCUIT_PURPOSE_S_ESTABLISH_INTRO
)
routelen
=
4
;
else
{
log_fn
(
LOG_WARN
,
"Unhandled purpose %d"
,
purpose
);
return
-
1
;
}
#endif
#if 0
for(routelen = 3; ; routelen++) { /* 3, increment until coinflip says we're done */
...
...
@@ -360,7 +369,7 @@ cpath_build_state_t *onion_new_cpath_build_state(uint8_t purpose,
routerinfo_t
*
exit
;
router_get_routerlist
(
&
rl
);
r
=
new_route_len
(
options
.
PathlenCoinWeight
,
rl
->
routers
);
r
=
new_route_len
(
options
.
PathlenCoinWeight
,
purpose
,
rl
->
routers
);
if
(
r
<
0
)
return
NULL
;
info
=
tor_malloc_zero
(
sizeof
(
cpath_build_state_t
));
...
...
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