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
66a564fa
Commit
66a564fa
authored
7 years ago
by
Nick Mathewson
Browse files
Options
Downloads
Plain Diff
Merge branch 'maint-0.3.1'
parents
ec29cae8
66258f88
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
changes/bug22883-config
+7
-0
7 additions, 0 deletions
changes/bug22883-config
doc/tor.1.txt
+10
-0
10 additions, 0 deletions
doc/tor.1.txt
src/or/config.c
+1
-0
1 addition, 0 deletions
src/or/config.c
src/or/consdiffmgr.c
+12
-1
12 additions, 1 deletion
src/or/consdiffmgr.c
src/or/or.h
+5
-0
5 additions, 0 deletions
src/or/or.h
with
35 additions
and
1 deletion
changes/bug22883-config
0 → 100644
+
7
−
0
View file @
66a564fa
o Minor features (directory cache, consensus diff):
- Add a new MaxConsensusAgeForDiffs option to allow directory cache
operators with low-resource environments to adjust the number of
consensuses they'll store and generate diffs from. Most cache operators
should leave it unchanged. Helps to work around bug 22883.
This diff is collapsed.
Click to expand it.
doc/tor.1.txt
+
10
−
0
View file @
66a564fa
...
...
@@ -2073,6 +2073,16 @@ details.)
because clients connect via the ORPort by default. Setting either DirPort
or BridgeRelay and setting DirCache to 0 is not supported. (Default: 1)
[[MaxConsensusAgeForDiffs]] **MaxConsensusAgeForDiffs** __N__ **minutes**|**hours**|**days**|**weeks**::
When this option is nonzero, Tor caches will not try to generate
consensus diffs for any consensus older than this amount of time.
If this option is set to zero, Tor will pick a reasonable default from
the current networkstatus document. You should not set this
option unless your cache is severely low on disk space or CPU.
If you need to set it, keeping it above 3 or 4 hours will help clients
much more than setting it to zero.
(Default: 0)
DIRECTORY AUTHORITY SERVER OPTIONS
----------------------------------
...
...
This diff is collapsed.
Click to expand it.
src/or/config.c
+
1
−
0
View file @
66a564fa
...
...
@@ -393,6 +393,7 @@ static config_var_t option_vars_[] = {
V
(
MaxAdvertisedBandwidth
,
MEMUNIT
,
"1 GB"
),
V
(
MaxCircuitDirtiness
,
INTERVAL
,
"10 minutes"
),
V
(
MaxClientCircuitsPending
,
UINT
,
"32"
),
V
(
MaxConsensusAgeForDiffs
,
INTERVAL
,
"0 seconds"
),
VAR
(
"MaxMemInQueues"
,
MEMUNIT
,
MaxMemInQueues_raw
,
"0"
),
OBSOLETE
(
"MaxOnionsPending"
),
V
(
MaxOnionQueueDelay
,
MSEC_INTERVAL
,
"1750 msec"
),
...
...
This diff is collapsed.
Click to expand it.
src/or/consdiffmgr.c
+
12
−
1
View file @
66a564fa
...
...
@@ -14,6 +14,7 @@
#define CONSDIFFMGR_PRIVATE
#include
"or.h"
#include
"config.h"
#include
"conscache.h"
#include
"consdiff.h"
#include
"consdiffmgr.h"
...
...
@@ -462,12 +463,22 @@ cdm_cache_lookup_consensus(consensus_flavor_t flavor, time_t valid_after)
static
int32_t
get_max_age_to_cache
(
void
)
{
/* The parameter is in hours. */
const
int32_t
DEFAULT_MAX_AGE_TO_CACHE
=
8192
;
const
int32_t
MIN_MAX_AGE_TO_CACHE
=
0
;
const
int32_t
MAX_MAX_AGE_TO_CACHE
=
8192
;
const
char
MAX_AGE_TO_CACHE_NAME
[]
=
"max-consensus-age-to-cache-for-diff"
;
const
or_options_t
*
options
=
get_options
();
if
(
options
->
MaxConsensusAgeForDiffs
)
{
const
int
v
=
options
->
MaxConsensusAgeForDiffs
;
if
(
v
>=
MAX_MAX_AGE_TO_CACHE
*
3600
)
return
MAX_MAX_AGE_TO_CACHE
;
else
return
v
;
}
/* The parameter is in hours, so we multiply */
return
3600
*
networkstatus_get_param
(
NULL
,
MAX_AGE_TO_CACHE_NAME
,
DEFAULT_MAX_AGE_TO_CACHE
,
...
...
This diff is collapsed.
Click to expand it.
src/or/or.h
+
5
−
0
View file @
66a564fa
...
...
@@ -4579,6 +4579,11 @@ typedef struct {
/** Bool (default: 0): Tells if a %include was used on torrc */
int
IncludeUsed
;
/** The seconds after expiration which we as a relay should keep old
* consensuses around so that we can generate diffs from them. If 0,
* use the default. */
int
MaxConsensusAgeForDiffs
;
}
or_options_t
;
/** Persistent state for an onion router, as saved to disk. */
...
...
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