Commit 07111640 authored by Michal Vaner's avatar Michal Vaner
Browse files

Merge preparation, step 3

The recursor compiles

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-config@3432 e5f2f494-b856-4b98-b285-d166d9295462
parent 68d78362
...@@ -86,16 +86,16 @@ public: ...@@ -86,16 +86,16 @@ public:
} }
void setForwardAddresses(const vector<addr_t>& upstream, void setForwardAddresses(const vector<addr_t>& upstream,
IOService* ios) DNSService *dnss)
{ {
queryShutdown(); queryShutdown();
upstream_ = upstream; upstream_ = upstream;
if (ios) { if (dnss) {
if (upstream_.empty()) { if (upstream_.empty()) {
cerr << "[b10-recurse] Asked to do full recursive," << endl << cerr << "[b10-recurse] Asked to do full recursive," << endl <<
"but not implemented yet. I'll do nothing." << endl; "but not implemented yet. I'll do nothing." << endl;
} else { } else {
querySetup(*ios); querySetup(*dnss);
} }
} }
} }
...@@ -525,7 +525,7 @@ Recursor::updateConfig(ConstElementPtr config) { ...@@ -525,7 +525,7 @@ Recursor::updateConfig(ConstElementPtr config) {
void void
Recursor::setForwardAddresses(const vector<addr_t>& addresses) Recursor::setForwardAddresses(const vector<addr_t>& addresses)
{ {
impl_->setForwardAddresses(addresses, io_); impl_->setForwardAddresses(addresses, dnss_);
} }
bool bool
...@@ -541,7 +541,7 @@ Recursor::getForwardAddresses() const { ...@@ -541,7 +541,7 @@ Recursor::getForwardAddresses() const {
namespace { namespace {
void void
setAddresses(IOService *service, const vector<addr_t>& addresses) { setAddresses(DNSService *service, const vector<addr_t>& addresses) {
service->clearServers(); service->clearServers();
BOOST_FOREACH(const addr_t &address, addresses) { BOOST_FOREACH(const addr_t &address, addresses) {
service->addServer(address.second, address.first); service->addServer(address.second, address.first);
...@@ -553,7 +553,7 @@ setAddresses(IOService *service, const vector<addr_t>& addresses) { ...@@ -553,7 +553,7 @@ setAddresses(IOService *service, const vector<addr_t>& addresses) {
void void
Recursor::setListenAddresses(const vector<addr_t>& addresses) { Recursor::setListenAddresses(const vector<addr_t>& addresses) {
try { try {
setAddresses(io_, addresses); setAddresses(dnss_, addresses);
impl_->listen_ = addresses; impl_->listen_ = addresses;
} }
catch (const exception& e) { catch (const exception& e) {
...@@ -565,7 +565,7 @@ Recursor::setListenAddresses(const vector<addr_t>& addresses) { ...@@ -565,7 +565,7 @@ Recursor::setListenAddresses(const vector<addr_t>& addresses) {
* and let boss start us again. * and let boss start us again.
*/ */
try { try {
setAddresses(io_, impl_->listen_); setAddresses(dnss_, impl_->listen_);
} }
catch (const exception& e2) { catch (const exception& e2) {
cerr << "[b10-recurse] Unable to recover from error: " << e.what() cerr << "[b10-recurse] Unable to recover from error: " << e.what()
......
...@@ -63,7 +63,7 @@ private: ...@@ -63,7 +63,7 @@ private:
class RecursorTest : public ::testing::Test { class RecursorTest : public ::testing::Test {
protected: protected:
RecursorTest() : server(*DEFAULT_REMOTE_ADDRESS), RecursorTest() : server(),
request_message(Message::RENDER), request_message(Message::RENDER),
parse_message(new Message(Message::PARSE)), parse_message(new Message(Message::PARSE)),
default_qid(0x1035), opcode(Opcode(Opcode::QUERY())), default_qid(0x1035), opcode(Opcode(Opcode::QUERY())),
...@@ -331,12 +331,13 @@ TEST_F(RecursorTest, notifyFail) { ...@@ -331,12 +331,13 @@ TEST_F(RecursorTest, notifyFail) {
class RecursorConfig : public ::testing::Test { class RecursorConfig : public ::testing::Test {
public: public:
IOService service; IOService ios;
DNSService dnss;
Recursor server; Recursor server;
RecursorConfig() : RecursorConfig() :
service(NULL, NULL, NULL) dnss(ios, NULL, NULL, NULL)
{ {
server.setIOService(service); server.setDNSService(dnss);
} }
void invalidTest(const string &JOSN); void invalidTest(const string &JOSN);
}; };
......
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