return true;
}
+string PipeBackend::directBackendCmd(const string &query) {
+ if (d_abiVersion < 5)
+ return "not supported on ABI version " + boost::lexical_cast<string>(d_abiVersion) + "(use ABI version 5 or later)\n";
+
+ ostringstream oss;
+
+ try {
+ ostringstream oss;
+ oss<<"CMD\t"<<query;
+ d_coproc->send(oss.str());
+ }
+ catch(PDNSException &ae) {
+ L<<Logger::Error<<kBackendId<<" Error from coprocess: "<<ae.reason<<endl;
+ throw;
+ }
+ oss.str("");
+
+ while(true) {
+ string line;
+ d_coproc->receive(line);
+ if (line == "END") break;
+ oss << line << std::endl;
+ };
+
+ return oss.str();
+}
+
//! For the dynamic loader
DNSBackend *PipeBackend::maker()
{
void lookup(const QType &, const string &qdomain, DNSPacket *p=0, int zoneId=-1);
bool list(const string &target, int domain_id, bool include_disabled=false);
bool get(DNSResourceRecord &r);
-
+ string directBackendCmd(const string &query);
static DNSBackend *maker();
private: