Commit 3f2864bf authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1177] Pass reversed name to the Accessor

parent f8720ba4
...@@ -566,7 +566,8 @@ DatabaseClient::Finder::find(const isc::dns::Name& name, ...@@ -566,7 +566,8 @@ DatabaseClient::Finder::find(const isc::dns::Name& name,
Name Name
DatabaseClient::Finder::findPreviousName(const Name& name) const { 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 Name
......
...@@ -171,7 +171,7 @@ public: ...@@ -171,7 +171,7 @@ public:
virtual const std::string& getDBName() const { return (database_name_); } virtual const std::string& getDBName() const { return (database_name_); }
/// \brief Concrete implementation of the pure virtual method /// \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& rname)
const; const;
private: private:
......
...@@ -539,7 +539,7 @@ public: ...@@ -539,7 +539,7 @@ public:
return (latest_clone_); return (latest_clone_);
} }
virtual std::string findPreviousName(int id, const std::string& name) virtual std::string findPreviousName(int id, const std::string& rname)
const const
{ {
// Hardcoded for now, but we could compute it from the data // Hardcoded for now, but we could compute it from the data
...@@ -547,9 +547,9 @@ public: ...@@ -547,9 +547,9 @@ public:
if (id == -1) { if (id == -1) {
isc_throw(isc::NotImplemented, "Test not implemented behaviour"); isc_throw(isc::NotImplemented, "Test not implemented behaviour");
} else if (id == 42) { } else if (id == 42) {
if (name == "example.org.") { if (rname == "org.example.") {
return ("zzz.example.org."); return ("zzz.example.org.");
} else if (name == "www2.example.org.") { } else if (rname == "org.example.www2.") {
return ("www.example.org."); return ("www.example.org.");
} else { } else {
isc_throw(isc::Unexpected, "Unexpected name"); isc_throw(isc::Unexpected, "Unexpected name");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment