Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mike Perry
Tor
Commits
22ccfc6b
Commit
22ccfc6b
authored
Mar 05, 2014
by
Nick Mathewson
🎨
Browse files
Rename PredictedCircsRelevanceTime->PredictedPortsRelevanceTime
All circuits are predictive; it's the ports that are expiring here.
parent
103cebd9
Changes
5
Hide whitespace changes
Inline
Side-by-side
changes/ticket9176
View file @
22ccfc6b
o Minor features:
- Made PREDICTED_CIRCS_RELEVANCE_TIME configurable from config
file. Implements ticket #9176. Patch by unixninja92.
file with a new option, PredictedPortsRelevanceTime. Implements
ticket #9176. Patch by unixninja92.
doc/tor.1.txt
View file @
22ccfc6b
...
...
@@ -544,7 +544,7 @@ GENERAL OPTIONS
following the Tor specification. Otherwise, they are logged with severity
\'info'. (Default: 0)
[[Predicted
Circ
sRelevanceTime]] **Predicted
Circ
sRelevanceTime** __NUM__::
[[Predicted
Port
sRelevanceTime]] **Predicted
Port
sRelevanceTime** __NUM__::
Set how long, after the client has mad an anonymized connection to a
given port, we will try to make sure that we build circuits to
exits that support that port. The maximum value for this option is 1
...
...
src/or/config.c
View file @
22ccfc6b
...
...
@@ -318,7 +318,7 @@ static config_var_t option_vars_[] = {
V
(
NATDListenAddress
,
LINELIST
,
NULL
),
VPORT
(
NATDPort
,
LINELIST
,
NULL
),
V
(
Nickname
,
STRING
,
NULL
),
V
(
Predicted
Circ
sRelevanceTime
,
INTERVAL
,
"1 hour"
),
V
(
Predicted
Port
sRelevanceTime
,
INTERVAL
,
"1 hour"
),
V
(
WarnUnsafeSocks
,
BOOL
,
"1"
),
OBSOLETE
(
"NoPublish"
),
VAR
(
"NodeFamily"
,
LINELIST
,
NodeFamilies
,
NULL
),
...
...
@@ -2382,7 +2382,7 @@ compute_publishserverdescriptor(or_options_t *options)
* services can overload the directory system. */
#define MIN_REND_POST_PERIOD (10*60)
/** Higest allowable value for Predicted
Circ
sRelevanceTime; if this is
/** Higest allowable value for Predicted
Port
sRelevanceTime; if this is
* too high, our selection of exits will decrease for an extended
* period of time to an uncomfortable level .*/
#define MAX_PREDICTED_CIRCS_RELEVANCE (60*60)
...
...
@@ -2847,11 +2847,11 @@ options_validate(or_options_t *old_options, or_options_t *options,
options
->
RendPostPeriod
=
MAX_DIR_PERIOD
;
}
if
(
options
->
Predicted
Circ
sRelevanceTime
>
if
(
options
->
Predicted
Port
sRelevanceTime
>
MAX_PREDICTED_CIRCS_RELEVANCE
)
{
log_warn
(
LD_CONFIG
,
"Predicted
Circ
sRelevanceTime is too large; "
log_warn
(
LD_CONFIG
,
"Predicted
Port
sRelevanceTime is too large; "
"clipping to %ds."
,
MAX_PREDICTED_CIRCS_RELEVANCE
);
options
->
Predicted
Circ
sRelevanceTime
=
MAX_PREDICTED_CIRCS_RELEVANCE
;
options
->
Predicted
Port
sRelevanceTime
=
MAX_PREDICTED_CIRCS_RELEVANCE
;
}
if
(
options
->
Tor2webMode
&&
options
->
LearnCircuitBuildTimeout
)
{
...
...
src/or/or.h
View file @
22ccfc6b
...
...
@@ -3638,7 +3638,7 @@ typedef struct {
* a new one? */
int
MaxCircuitDirtiness
;
/**< Never use circs that were first used more than
this interval ago. */
int
Predicted
Circ
sRelevanceTime
;
/** How long after we've requested a
int
Predicted
Port
sRelevanceTime
;
/** How long after we've requested a
* connection for a given port, do we want
* to continue to pick exits that support
* that port? */
...
...
src/or/rephist.c
View file @
22ccfc6b
...
...
@@ -1871,7 +1871,7 @@ rep_hist_get_predicted_ports(time_t now)
int
predicted_circs_relevance_time
;
smartlist_t
*
out
=
smartlist_new
();
tor_assert
(
predicted_ports_list
);
predicted_circs_relevance_time
=
get_options
()
->
Predicted
Circ
sRelevanceTime
;
predicted_circs_relevance_time
=
get_options
()
->
Predicted
Port
sRelevanceTime
;
/* clean out obsolete entries */
SMARTLIST_FOREACH_BEGIN
(
predicted_ports_list
,
predicted_port_t
*
,
pp
)
{
...
...
@@ -1943,7 +1943,7 @@ rep_hist_get_predicted_internal(time_t now, int *need_uptime,
int
*
need_capacity
)
{
int
predicted_circs_relevance_time
;
predicted_circs_relevance_time
=
get_options
()
->
Predicted
Circ
sRelevanceTime
;
predicted_circs_relevance_time
=
get_options
()
->
Predicted
Port
sRelevanceTime
;
if
(
!
predicted_internal_time
)
{
/* initialize it */
predicted_internal_time
=
now
;
...
...
@@ -1965,7 +1965,7 @@ int
any_predicted_circuits
(
time_t
now
)
{
int
predicted_circs_relevance_time
;
predicted_circs_relevance_time
=
get_options
()
->
Predicted
Circ
sRelevanceTime
;
predicted_circs_relevance_time
=
get_options
()
->
Predicted
Port
sRelevanceTime
;
return
smartlist_len
(
predicted_ports_list
)
||
predicted_internal_time
+
predicted_circs_relevance_time
>=
now
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment