Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
9e8813ef
Commit
9e8813ef
authored
Dec 10, 2012
by
Michal 'vorner' Vaner
Browse files
[2377] Reject load incremental of 0 RRs
As it makes little sense.
parent
85c5f472
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lib/dns/master_loader.cc
View file @
9e8813ef
...
...
@@ -108,6 +108,9 @@ public:
bool
MasterLoader
::
MasterLoaderImpl
::
loadIncremental
(
size_t
count_limit
)
{
if
(
count_limit
==
0
)
{
isc_throw
(
isc
::
InvalidParameter
,
"Count limit set to 0"
);
}
if
(
complete_
)
{
isc_throw
(
isc
::
InvalidOperation
,
"Trying to load when already loaded"
);
...
...
src/lib/dns/tests/master_loader_unittest.cc
View file @
9e8813ef
...
...
@@ -299,4 +299,12 @@ TEST_F(MasterLoaderTest, loadTwice) {
loader_
->
load
();
EXPECT_THROW
(
loader_
->
load
(),
isc
::
InvalidOperation
);
}
// Load 0 items should be rejected
TEST_F
(
MasterLoaderTest
,
loadZero
)
{
setLoader
(
TEST_DATA_SRCDIR
"/example.org"
,
Name
(
"example.org."
),
RRClass
::
IN
(),
MasterLoader
::
MANY_ERRORS
);
EXPECT_THROW
(
loader_
->
loadIncremental
(
0
),
isc
::
InvalidParameter
);
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment