Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
61e7f493
Commit
61e7f493
authored
Mar 16, 2011
by
Jelte Jansen
Browse files
[trac471] address review comments
parent
13a3fcfa
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/resolver/resolver.cc
View file @
61e7f493
...
...
@@ -584,11 +584,6 @@ Resolver::updateConfig(ConstElementPtr config) {
}
}
void
Resolver
::
setConfigured
()
{
configured_
=
true
;
}
void
Resolver
::
setForwardAddresses
(
const
AddressList
&
addresses
)
{
...
...
src/bin/resolver/resolver.h
View file @
61e7f493
...
...
@@ -119,11 +119,11 @@ public:
asiolink
::
SimpleCallback
*
getCheckinProvider
()
{
return
(
checkin_
);
}
/**
* \brief Tell the Resolver that is
should
has already been
*
configured (used by updateConfig() and tests, so
*
that it will only set some defaults the first time
* \brief Tell the Resolver that is has already been
configured
*
so that it will only set some defaults the first time
*
(used by updateConfig() and tests)
*/
void
setConfigured
();
void
setConfigured
()
{
configured_
=
true
;
}
;
/**
* \brief Specify the list of upstream servers.
...
...
src/lib/config/module_spec.cc
View file @
61e7f493
...
...
@@ -373,19 +373,17 @@ ModuleSpec::validateSpecList(ConstElementPtr spec, ConstElementPtr data,
BOOST_FOREACH
(
maptype
m
,
data
->
mapValue
())
{
bool
found
=
false
;
// Ignore 'version' as a config element
if
(
m
.
first
.
compare
(
"version"
)
==
0
)
{
found
=
true
;
}
else
{
if
(
m
.
first
.
compare
(
"version"
)
!=
0
)
{
BOOST_FOREACH
(
ConstElementPtr
cur_spec_el
,
spec
->
listValue
())
{
if
(
cur_spec_el
->
get
(
"item_name"
)
->
stringValue
().
compare
(
m
.
first
)
==
0
)
{
found
=
true
;
}
}
}
if
(
!
found
)
{
validated
=
false
;
if
(
errors
)
{
errors
->
add
(
Element
::
create
(
"Unknown item "
+
m
.
first
));
if
(
!
found
)
{
validated
=
false
;
if
(
errors
)
{
errors
->
add
(
Element
::
create
(
"Unknown item "
+
m
.
first
));
}
}
}
}
...
...
src/lib/config/tests/module_spec_unittests.cc
View file @
61e7f493
...
...
@@ -162,6 +162,10 @@ TEST(ModuleSpec, DataValidation) {
EXPECT_FALSE
(
dataTest
(
dd
,
"data22_8.data"
));
EXPECT_FALSE
(
dataTest
(
dd
,
"data22_9.data"
));
// Test if "version" is allowed in config data
// (same data as 22_7, but added "version")
EXPECT_TRUE
(
dataTest
(
dd
,
"data22_10.data"
));
ElementPtr
errors
=
Element
::
createList
();
EXPECT_FALSE
(
dataTestWithErrors
(
dd
,
"data22_8.data"
,
errors
));
EXPECT_EQ
(
"[
\"
Type mismatch
\"
]"
,
errors
->
str
());
...
...
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