From 81fec33c61bad2fb707ea776c40c5e4fad623cd2 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Wed, 12 Dec 2012 13:28:27 +0000 Subject: [PATCH] clarify exception when remotebackend is compiled without http; minor cleanups. Thanks Aki Tuomi. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2984 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- modules/remotebackend/remotebackend.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/remotebackend/remotebackend.cc b/modules/remotebackend/remotebackend.cc index 622897bf6..7fd10955e 100644 --- a/modules/remotebackend/remotebackend.cc +++ b/modules/remotebackend/remotebackend.cc @@ -76,7 +76,7 @@ int RemoteBackend::build(const std::string &connstr) { size_t pos; pos = connstr.find_first_of(":"); if (pos == std::string::npos) - throw new AhuException("Invalid connection string: malformed"); + throw AhuException("Invalid connection string: malformed"); type = connstr.substr(0, pos); opts = connstr.substr(pos+1); @@ -106,14 +106,16 @@ int RemoteBackend::build(const std::string &connstr) { // connectors know what they are doing if (type == "unix") { this->connector = new UnixsocketConnector(options); -#ifdef REMOTEBACKEND_HTTP } else if (type == "http") { +#ifdef REMOTEBACKEND_HTTP this->connector = new HTTPConnector(options); +#else + throw AhuException("Invalid connection string: http connector support not enabled. Recompile with --enable-remotebackend-http"); #endif } else if (type == "pipe") { this->connector = new PipeConnector(options); } else { - throw new AhuException("Invalid connection string: unknown connector"); + throw AhuException("Invalid connection string: unknown connector"); } return -1; @@ -448,7 +450,7 @@ bool RemoteBackend::getDomainInfo(const string &domain, DomainInfo &di) { // make sure we got zone & kind if (!answer.HasMember("zone")) { L<