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
3c8baa77
Commit
3c8baa77
authored
Aug 19, 2016
by
Nick Mathewson
⛰
Browse files
Log a warning when Testing options are deprecated.
parent
05ad2db2
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/or/config.c
View file @
3c8baa77
...
...
@@ -545,7 +545,7 @@ static const config_var_t testing_tor_network_defaults[] = {
"0, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 16, 32, 60"
),
V
(
ClientBootstrapConsensusMaxDownloadTries
,
UINT
,
"80"
),
V
(
ClientBootstrapConsensusAuthorityOnlyMaxDownloadTries
,
UINT
,
"80"
),
V
(
ClientDNSRejectInternalAddresses
,
BOOL
,
"0"
),
V
(
ClientDNSRejectInternalAddresses
,
BOOL
,
"0"
),
// deprecated in 0.2.9.2-alpha
V
(
ClientRejectInternalAddresses
,
BOOL
,
"0"
),
V
(
CountPrivateBandwidth
,
BOOL
,
"1"
),
V
(
ExitPolicyRejectPrivate
,
BOOL
,
"0"
),
...
...
@@ -4924,6 +4924,12 @@ options_init_from_string(const char *cf_defaults, const char *cf,
tor_assert
(
new_var
);
tor_assert
(
old_var
);
old_var
->
initvalue
=
new_var
->
initvalue
;
if
((
config_find_deprecation
(
&
options_format
,
new_var
->
name
)))
{
log_warn
(
LD_GENERAL
,
"Testing options override the deprecated "
"option %s. Is that intentional?"
,
new_var
->
name
);
}
}
/* Clear newoptions and re-initialize them with new defaults. */
...
...
src/or/confparse.c
View file @
3c8baa77
...
...
@@ -184,7 +184,7 @@ config_free_lines(config_line_t *front)
/** If <b>key</b> is a deprecated configuration option, return the message
* explaining why it is deprecated (which may be an empty string). Return NULL
* if it is not deprecated. The <b>key</b> field must be fully expanded. */
static
const
char
*
const
char
*
config_find_deprecation
(
const
config_format_t
*
fmt
,
const
char
*
key
)
{
if
(
BUG
(
fmt
==
NULL
)
||
BUG
(
key
==
NULL
))
...
...
src/or/confparse.h
View file @
3c8baa77
...
...
@@ -127,6 +127,8 @@ int config_assign(const config_format_t *fmt, void *options,
unsigned
flags
,
char
**
msg
);
config_var_t
*
config_find_option_mutable
(
config_format_t
*
fmt
,
const
char
*
key
);
const
char
*
config_find_deprecation
(
const
config_format_t
*
fmt
,
const
char
*
key
);
const
config_var_t
*
config_find_option
(
const
config_format_t
*
fmt
,
const
char
*
key
);
...
...
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