caffe82
Index: /trunk/pdns/pdns/packethandler.cc
caffe82
===================================================================
caffe82
--- /trunk/pdns/pdns/packethandler.cc (revision 1079)
caffe82
+++ /trunk/pdns/pdns/packethandler.cc (revision 1081)
caffe82
@@ -399,6 +399,8 @@
caffe82
       }
caffe82
     }
caffe82
-    if(hits && !found && !rfound && shortcut ) // we found matching qnames but not a qtype
caffe82
+    if(hits && !found && !rfound && shortcut ) { // we found matching qnames but not a qtype
caffe82
+      DLOG(L<<"Found matching qname, but not the qtype"<
caffe82
       return 2;
caffe82
+    }
caffe82
 
caffe82
     if(rfound)
caffe82
@@ -654,4 +656,5 @@
caffe82
 
caffe82
     if(mret==2) { // there is some data, but not of the correct type
caffe82
+      r->clearRecords();
caffe82
       DLOG(L<<"There is some data, but not of the correct type, adding SOA for NXRECORDSET"<
caffe82
       SOAData sd;
caffe82
@@ -696,5 +699,4 @@
caffe82
       }
caffe82
     }
caffe82
-
caffe82
     noSameLevelNS=true;
caffe82
 
caffe82
@@ -739,5 +741,5 @@
caffe82
     // not found yet, try wildcards (we only try here in case of recursion - we should check before we hand off)
caffe82
 
caffe82
-    if(p->d.rd && d_doRecursion && d_doWildcards) { 
caffe82
+    if(mret != 2 && p->d.rd && d_doRecursion && d_doWildcards) { 
caffe82
       int res=doWildcardRecords(p,r,target);
caffe82
       if(res) { // had a result