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
b0aaa884
Commit
b0aaa884
authored
18 years ago
by
Roger Dingledine
Browse files
Options
Downloads
Patches
Plain Diff
make the prefertunnel stuff less obviously broken
svn:r9697
parent
2780bb74
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/circuituse.c
+10
-5
10 additions, 5 deletions
src/or/circuituse.c
with
10 additions
and
5 deletions
src/or/circuituse.c
+
10
−
5
View file @
b0aaa884
...
@@ -81,8 +81,8 @@ circuit_is_acceptable(circuit_t *circ, edge_connection_t *conn,
...
@@ -81,8 +81,8 @@ circuit_is_acceptable(circuit_t *circ, edge_connection_t *conn,
return
0
;
return
0
;
if
(
purpose
==
CIRCUIT_PURPOSE_C_GENERAL
)
{
if
(
purpose
==
CIRCUIT_PURPOSE_C_GENERAL
)
{
if
(
!
exitrouter
)
{
if
(
!
exitrouter
&&
!
build_state
->
onehop_tunnel
)
{
log_debug
(
LD_CIRC
,
"Not considering circuit with unknown router."
);
log_debug
(
LD_CIRC
,
"Not considering circuit with unknown router."
);
return
0
;
/* this circuit is screwed and doesn't know it yet,
return
0
;
/* this circuit is screwed and doesn't know it yet,
* or is a rendezvous circuit. */
* or is a rendezvous circuit. */
}
}
...
@@ -98,7 +98,7 @@ circuit_is_acceptable(circuit_t *circ, edge_connection_t *conn,
...
@@ -98,7 +98,7 @@ circuit_is_acceptable(circuit_t *circ, edge_connection_t *conn,
return
0
;
return
0
;
}
}
}
}
if
(
!
connection_ap_can_use_exit
(
conn
,
exitrouter
))
{
if
(
exitrouter
&&
!
connection_ap_can_use_exit
(
conn
,
exitrouter
))
{
/* can't exit from this router */
/* can't exit from this router */
return
0
;
return
0
;
}
}
...
@@ -1019,12 +1019,15 @@ circuit_get_open_circ_or_launch(edge_connection_t *conn,
...
@@ -1019,12 +1019,15 @@ circuit_get_open_circ_or_launch(edge_connection_t *conn,
if
(
r
)
{
if
(
r
)
{
extend_info
=
extend_info_from_router
(
r
);
extend_info
=
extend_info_from_router
(
r
);
}
else
{
}
else
{
log_debug
(
LD_DIR
,
"considering %d, %s"
,
want_onehop
,
conn
->
chosen_exit_name
);
if
(
want_onehop
&&
conn
->
chosen_exit_name
[
0
]
==
'$'
)
{
if
(
want_onehop
&&
conn
->
chosen_exit_name
[
0
]
==
'$'
)
{
/* We're asking for a one-hop circuit to a router that
/* We're asking for a one-hop circuit to a router that
* we don't have a routerinfo about. Hope we have a
* we don't have a routerinfo about. Hope we have a
* routerstatus or equivalent. */
* routerstatus or equivalent. */
routerstatus_t
*
s
=
routerstatus_t
*
s
=
routerstatus_get_by_hexdigest
(
conn
->
chosen_exit_name
+
1
);
routerstatus_get_by_hexdigest
(
conn
->
chosen_exit_name
+
1
);
log_debug
(
LD_DIR
,
"result is %d"
,
(
int
)
s
);
if
(
s
)
{
if
(
s
)
{
extend_info
=
extend_info_from_routerstatus
(
s
);
extend_info
=
extend_info_from_routerstatus
(
s
);
}
else
{
}
else
{
...
@@ -1204,10 +1207,12 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
...
@@ -1204,10 +1207,12 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
{
{
int
retval
;
int
retval
;
int
conn_age
;
int
conn_age
;
int
want_onehop
;
tor_assert
(
conn
);
tor_assert
(
conn
);
tor_assert
(
conn
->
_base
.
state
==
AP_CONN_STATE_CIRCUIT_WAIT
);
tor_assert
(
conn
->
_base
.
state
==
AP_CONN_STATE_CIRCUIT_WAIT
);
tor_assert
(
conn
->
socks_request
);
tor_assert
(
conn
->
socks_request
);
want_onehop
=
conn
->
socks_request
->
command
==
SOCKS_COMMAND_CONNECT_DIR
;
conn_age
=
time
(
NULL
)
-
conn
->
_base
.
timestamp_created
;
conn_age
=
time
(
NULL
)
-
conn
->
_base
.
timestamp_created
;
...
@@ -1217,7 +1222,7 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
...
@@ -1217,7 +1222,7 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
if
(
conn
->
chosen_exit_name
)
{
if
(
conn
->
chosen_exit_name
)
{
routerinfo_t
*
router
=
router_get_by_nickname
(
conn
->
chosen_exit_name
,
1
);
routerinfo_t
*
router
=
router_get_by_nickname
(
conn
->
chosen_exit_name
,
1
);
int
opt
=
conn
->
_base
.
chosen_exit_optional
;
int
opt
=
conn
->
_base
.
chosen_exit_optional
;
if
(
!
router
)
{
if
(
!
router
&&
!
want_onehop
)
{
log_fn
(
opt
?
LOG_INFO
:
LOG_WARN
,
LD_APP
,
log_fn
(
opt
?
LOG_INFO
:
LOG_WARN
,
LD_APP
,
"Requested exit point '%s' is not known. %s."
,
"Requested exit point '%s' is not known. %s."
,
conn
->
chosen_exit_name
,
opt
?
"Trying others"
:
"Closing"
);
conn
->
chosen_exit_name
,
opt
?
"Trying others"
:
"Closing"
);
...
@@ -1228,7 +1233,7 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
...
@@ -1228,7 +1233,7 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
}
}
return
-
1
;
return
-
1
;
}
}
if
(
!
connection_ap_can_use_exit
(
conn
,
router
))
{
if
(
router
&&
!
connection_ap_can_use_exit
(
conn
,
router
))
{
log_fn
(
opt
?
LOG_INFO
:
LOG_WARN
,
LD_APP
,
log_fn
(
opt
?
LOG_INFO
:
LOG_WARN
,
LD_APP
,
"Requested exit point '%s' would refuse request. %s."
,
"Requested exit point '%s' would refuse request. %s."
,
conn
->
chosen_exit_name
,
opt
?
"Trying others"
:
"Closing"
);
conn
->
chosen_exit_name
,
opt
?
"Trying others"
:
"Closing"
);
...
...
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