]> granicus.if.org Git - pdns/commitdiff
improve error messages some more
authorBert Hubert <bert.hubert@netherlabs.nl>
Mon, 27 Mar 2006 13:06:00 +0000 (13:06 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Mon, 27 Mar 2006 13:06:00 +0000 (13:06 +0000)
Update README for the recursor separate package
Make trailing garbage no longer be fatal
Make separate recursor do skip-locking by default

git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@637 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/Makefile-recursor
pdns/README-recursor
pdns/config-recursor.h
pdns/dnsparser.cc
pdns/pdns_recursor.cc

index 8acedabfb07ad06c56e722c386d2a8572fa9e173..7bc02bb4c07791eb212066251ced0976ec86c8ad 100644 (file)
@@ -3,8 +3,8 @@ SBINDIR=/usr/sbin/
 # for socket location, see config.h
 
 OPTFLAGS?=-O3
-CXXFLAGS:= $(CXXFLAGS) -Wall $(OPTFLAGS)
-
+CXXFLAGS:= $(CXXFLAGS) -Wall $(OPTFLAGS) $(PROFILEFLAGS)
+LDFLAGS+= $(PROFILEFLAGS)
 all: pdns_recursor rec_control
 
 install: all
@@ -27,9 +27,9 @@ rec_channel.o rec_channel_rec.o
 REC_CONTROL_OBJECTS=rec_channel.o rec_control.o arguments.o 
 
 pdns_recursor: $(PDNS_RECURSOR_OBJECTS)
-       g++ $(PDNS_RECURSOR_OBJECTS) -o $@
+       g++ $(PDNS_RECURSOR_OBJECTS) $(LDFLAGS) -o $@
 
 rec_control: $(REC_CONTROL_OBJECTS)
-       g++ $(REC_CONTROL_OBJECTS) -o $@
+       g++ $(REC_CONTROL_OBJECTS) $(LDFLAGS) -o $@
 
 
index b30f7323a27f849c6f1383d7734850b590ce7dde..eab1c2cadbbfabea675e36a739eb991de9fc07fa 100644 (file)
@@ -19,4 +19,28 @@ $ tar xjf boost_1_33_1.tar.bz2
 $ CXXFLAGS=-I./boost-1.33.1/ make
 
 4) Run ./pdns_recursor and you should be set!
\ No newline at end of file
+
+
+PERFORMANCE
+-----------
+
+For the utmost in performance, compile like this:
+
+   $ PROFILEFLAGS=-fprofile-generate make
+
+Then run the program for a bit, in as much of a real-life setting as you
+have available. Then run:
+
+   $ rec_control quit
+   bye 
+
+Then do:
+
+   $ PROFILEFLAGS=-fprofile-use make clean all
+
+The resulting binary is up to 20% faster in our tests.
+
+PROBLEMS
+--------
+If you have problems linking, try removing the GCC_SKIP_LOCKING line from
+config.h
index b79fd92d4c393199e92017b61dd4b293eb2c88af..ff56c283934001183377714a7af8084a5a2cd838 100644 (file)
@@ -2,3 +2,4 @@
 #define LOCALSTATEDIR "/var/run/" 
 #define VERSION "2.9.21"
 #define RECURSOR
+#define GCC_SKIP_LOCKING
index e5eb7e9a5d8c177f039062d08897e6bc311648c5..04d8f9b4c9c68304b3b48417d0122ea5c09067ab 100644 (file)
@@ -226,11 +226,13 @@ void MOADNSParser::init(const char *packet, unsigned int len)
       dr.d_content=boost::shared_ptr<DNSRecordContent>(DNSRecordContent::mastermake(dr, pr));
       d_answers.push_back(make_pair(dr, pr.d_pos));
     }
-    
+
+#if 0    
     if(pr.d_pos!=contentlen) {
       throw MOADNSException("Packet ("+d_qname+"|#"+lexical_cast<string>(d_qtype)+") has trailing garbage ("+ lexical_cast<string>(pr.d_pos) + " < " + 
                            lexical_cast<string>(contentlen) + ")");
     }
+#endif 
   }
   catch(out_of_range &re) {
     throw MOADNSException("Packet parsing error, out of bounds: "+string(re.what()));
index b79796ffd588519d52f8fbbdbf79d51322e45876..079400cf163a8f886319a74d11c221635d8200da 100644 (file)
@@ -289,6 +289,7 @@ void startDoResolve(void *p)
     int res=sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), ret);
     if(res<0) {
       pw.getHeader()->rcode=RCode::ServFail;
+      pw.commit();
       g_stats.servFails++;
     }
     else {
@@ -864,7 +865,7 @@ int main(int argc, char **argv)
              L<<Logger::Warning<<"Ignoring question on outgoing socket from "<<dc.getRemote()<<endl;
          }
          catch(MOADNSException& mde) {
-           L<<Logger::Error<<"Unparseable packet from remote server "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
+           L<<Logger::Error<<"Unable to parse packet from remote UDP server "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
          }
        }
       }
@@ -889,7 +890,7 @@ int main(int argc, char **argv)
              }
             }
            catch(MOADNSException& mde) {
-             L<<Logger::Error<<"Unparseable packet from remote client "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
+             L<<Logger::Error<<"Unable to parse packet from remote udp client "<< sockAddrToString((struct sockaddr_in*) &fromaddr, addrlen) <<": "<<mde.what()<<endl;
            }
           }
        }
@@ -1021,7 +1022,7 @@ int main(int argc, char **argv)
                dc=new DNSComboWriter(i->data, i->qlen, now);
              }
              catch(MOADNSException &mde) {
-               L<<Logger::Error<<"Unparseable packet from remote TCP client "<<sockAddrToString(&i->remote,sizeof(i->remote))<<endl;
+               L<<Logger::Error<<"Unable to parse packet from remote TCP client "<<sockAddrToString(&i->remote,sizeof(i->remote))<<endl;
                close(i->fd);
                tcpconnections.erase(i);
                break;