From 3bade47a61c1b6c1f2b9b28f2a98c01c3cd0766f Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Wed, 3 Oct 2012 18:22:27 +0000 Subject: [PATCH] remove some whitespace, add an 'MX' record to sample pipe backend script, plus remove 3 bugs from it git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2735 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- modules/pipebackend/backend-v3.pl | 10 +++++----- modules/pipebackend/pipebackend.cc | 3 --- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/pipebackend/backend-v3.pl b/modules/pipebackend/backend-v3.pl index c4d08fe16..84d67729b 100755 --- a/modules/pipebackend/backend-v3.pl +++ b/modules/pipebackend/backend-v3.pl @@ -43,7 +43,7 @@ while(<>) print "DATA $bits $auth $qname $qclass NS 3600 -1 ns2.example.com\n"; } if(($qtype eq "TXT" || $qtype eq "ANY") && $qname eq "example.com") { - print STDERR "$$ Sent NS records\n"; + print STDERR "$$ Sent TXT records\n"; print "DATA $bits $auth $qname $qclass TXT 3600 -1 \"hallo allemaal!\"\n"; } if(($qtype eq "A" || $qtype eq "ANY") && $qname eq "webserver.example.com") { @@ -52,13 +52,13 @@ while(<>) print "DATA $bits $auth $qname $qclass A 3600 -1 1.2.3.5\n"; print "DATA $bits $auth $qname $qclass A 3600 -1 1.2.3.6\n"; } - elsif(($qtype eq "CNAME" || $qtype eq "ANY") && $qname eq "www.example.com") { + if(($qtype eq "CNAME" || $qtype eq "ANY") && $qname eq "www.example.com") { print STDERR "$$ Sent CNAME records\n"; print "DATA $bits $auth $qname $qclass CNAME 3600 -1 webserver.example.com\n"; } - elsif($qtype eq "MBOXFW") { - print STDERR "$$ Sent MBOXFW records\n"; - print "DATA $bits $auth $qname $qclass MBOXFW 3600 -1 powerdns\@example.com\n"; + if(($qtype eq "MX" || $qtype eq "ANY") && $qname eq "example.com") { + print STDERR "$$ Sent MX records\n"; + print "DATA $bits $auth $qname $qclass MX 3600 -1 25 smtp.powerdns.com\n"; } diff --git a/modules/pipebackend/pipebackend.cc b/modules/pipebackend/pipebackend.cc index 255eb7c6b..e67a4b7d8 100644 --- a/modules/pipebackend/pipebackend.cc +++ b/modules/pipebackend/pipebackend.cc @@ -196,7 +196,6 @@ bool PipeBackend::get(DNSResourceRecord &r) extraFields = 2; for(;;) { - d_coproc->receive(line); vectorparts; stringtok(parts,line,"\t"); @@ -233,8 +232,6 @@ bool PipeBackend::get(DNSResourceRecord &r) r.ttl=atoi(parts[4+extraFields].c_str()); r.domain_id=atoi(parts[5+extraFields].c_str()); - - if(r.qtype.getCode() != QType::MX && r.qtype.getCode() != QType::SRV) { r.content.clear(); for(unsigned int n= 6 + extraFields; n < parts.size(); ++n) { -- 2.40.0