]> granicus.if.org Git - pdns/commitdiff
umf
authorBert Hubert <bert.hubert@netherlabs.nl>
Fri, 3 Jan 2003 23:51:54 +0000 (23:51 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Fri, 3 Jan 2003 23:51:54 +0000 (23:51 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@116 d19b8d6e-7fed-0310-83ef-9ca221ded41b

ChangeLog
pdns/dnsbackend.cc
pdns/resolver.cc
pdns/tcpreceiver.cc
pdns/ueberbackend.cc

index e199ac73d97fcf04d6f9ec8823e9396012bebd53..1b8e5737c8c0451b6ba0d8701cd7c980bd97d2ff 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,12 +8,16 @@ Changes since 2.9.3a:
        - make IPv6 work again on FreeBSD (Peter van Dijk)
        - neglected to properly initialize the socklen of accept of dynlistener ;-(
        - make *all* sql in gsqlbackends available for configuration (Martin Klebermass/bert hubert)
-       - multiple backende+axfr work again
+       - multiple backends+axfr work again
        - axfr backend transaction now only started after first actual
          record is in
        - improve bindbackend abortTransaction
+               should no longer block the zone
        - huge improvement in performance of bind-domain-status
                (spotted by Erik Bos)
+       - further alignment fixes (should help on UltraSparc)
+       - AXFR terminated with an EOF is now an error, unless a second SOA
+               was seen
 
 Changes since 2.9.2:
        - windows compilation patches
index 10fba13a31d3c3ec2f24ce8f0422eaadf37b510e..cd205da2ea7e0f728a685e1f2fe8de80d343f698 100644 (file)
@@ -266,6 +266,10 @@ vector<DNSBackend *>BackendMakerClass::all()
     Returns false if there is definitely no SOA for the domain. May throw a DBException
     to indicate that the backend is currently unable to supply an answer.
 
+    WARNING: This function *may* fill out the db attribute of the SOAData, but then again,
+    it may not! If you find a zero in there, you may have been handed a non-live and cached
+    answer, in which case you need to perform a getDomainInfo call!
+
     \param domain Domain we want to get the SOA details of
     \param sd SOAData which is filled with the SOA details
 */
index 3301ed55d88e1262b1004a324b6846a1be706d6c..9029d9cbda21f4f3a0004cd0acc8020c850408fc 100644 (file)
@@ -338,7 +338,7 @@ int Resolver::axfrChunk(Resolver::res_t &res)
   // d_sock is connected and is about to spit out a packet
   int len=getLength();
   if(len<0)
-    return 0;
+    throw ResolverException("EOF trying to read axfr chunk from remote TCP client");
   
   timeoutReadn((char *)d_buf,len); 
   d_len=len;
index dbc81d10718eb167f7200e45e56313c018be9970..69321714f3faf3e4bc3ac2cbfb45e21fb2fba768 100644 (file)
@@ -300,6 +300,18 @@ int TCPNameserver::doAXFR(const string &target, DNSPacket *q, int outsock)
     soa.ttl=sd.default_ttl;
     soa.domain_id=sd.domain_id;
     soa.d_place=DNSResourceRecord::ANSWER;
+    
+    if(!sd.db) { // we got a cached answer
+      DomainInfo di;
+      if(!s_P->getBackend()->getDomainInfo(target, di) || !di.backend) {
+       L<<Logger::Error<<"Error determining backend for domain '"<<target<<"' trying to serve an AXFR"<<endl;
+       outpacket->setRcode(RCode::ServFail);
+       sendDelPacket(outpacket,outsock);
+       return 0;
+      }
+      sd.db=di.backend;
+    }
+
   }
  
   DLOG(L<<"Issuing list command - opening dedicated database connection"<<endl);
index ed744044494cd1f0e7c167227db1fe83aff56f62..695682063756cc00aeeef119fef07b50eef181b9 100644 (file)
@@ -16,7 +16,7 @@
     along with this program; if not, write to the Free Software
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
-// $Id: ueberbackend.cc,v 1.8 2003/01/02 15:43:00 ahu Exp $ 
+// $Id: ueberbackend.cc,v 1.9 2003/01/03 23:51:54 ahu Exp $ 
 /* (C) Copyright 2002 PowerDNS.COM BV */
 #include "utility.hh"
 
@@ -155,7 +155,7 @@ bool UeberBackend::getSOA(const string &domain, SOAData &sd)
     DNSPacket::fillSOAData(d_answer.content,sd);
     sd.domain_id=d_answer.domain_id;
     sd.ttl=d_answer.ttl;
-
+    sd.db=0;
     return true;
   }