Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
3f2864bf
Commit
3f2864bf
authored
Sep 09, 2011
by
Michal 'vorner' Vaner
Browse files
[1177] Pass reversed name to the Accessor
parent
f8720ba4
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/database.cc
View file @
3f2864bf
...
...
@@ -566,7 +566,8 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
Name
DatabaseClient
::
Finder
::
findPreviousName
(
const
Name
&
name
)
const
{
return
(
Name
(
accessor_
->
findPreviousName
(
zone_id_
,
name
.
toText
())));
return
(
Name
(
accessor_
->
findPreviousName
(
zone_id_
,
name
.
reverse
().
toText
())));
}
Name
...
...
src/lib/datasrc/sqlite3_accessor.h
View file @
3f2864bf
...
...
@@ -171,7 +171,7 @@ public:
virtual
const
std
::
string
&
getDBName
()
const
{
return
(
database_name_
);
}
/// \brief Concrete implementation of the pure virtual method
virtual
std
::
string
findPreviousName
(
int
zone_id
,
const
std
::
string
&
name
)
virtual
std
::
string
findPreviousName
(
int
zone_id
,
const
std
::
string
&
r
name
)
const
;
private:
...
...
src/lib/datasrc/tests/database_unittest.cc
View file @
3f2864bf
...
...
@@ -539,7 +539,7 @@ public:
return
(
latest_clone_
);
}
virtual
std
::
string
findPreviousName
(
int
id
,
const
std
::
string
&
name
)
virtual
std
::
string
findPreviousName
(
int
id
,
const
std
::
string
&
r
name
)
const
{
// Hardcoded for now, but we could compute it from the data
...
...
@@ -547,9 +547,9 @@ public:
if
(
id
==
-
1
)
{
isc_throw
(
isc
::
NotImplemented
,
"Test not implemented behaviour"
);
}
else
if
(
id
==
42
)
{
if
(
name
==
"example.
org.
"
)
{
if
(
r
name
==
"
org.
example."
)
{
return
(
"zzz.example.org."
);
}
else
if
(
name
==
"
www2
.example.
org
."
)
{
}
else
if
(
r
name
==
"
org
.example.
www2
."
)
{
return
(
"www.example.org."
);
}
else
{
isc_throw
(
isc
::
Unexpected
,
"Unexpected name"
);
...
...
Write
Preview
Markdown
is supported
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