]> granicus.if.org Git - pdns/commitdiff
tiny speedups, raise version. should save around 20 microseconds/packet
authorBert Hubert <bert.hubert@netherlabs.nl>
Wed, 14 Jun 2006 21:37:47 +0000 (21:37 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Wed, 14 Jun 2006 21:37:47 +0000 (21:37 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@850 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/config-recursor.h
pdns/dist-recursor
pdns/lwres.cc
pdns/pdns-recursor.spec
pdns/rcpgenerator.cc

index 46b26f4f18651c7710bfe1e6fcfaeb8eb6175d7b..2be0c4554364a73fe91943b8db41dbb290bd0584 100644 (file)
@@ -1,6 +1,6 @@
 #define SYSCONFDIR "/etc/powerdns/" 
 #define LOCALSTATEDIR "/var/run/" 
-#define VERSION "3.1.1"
+#define VERSION "3.1.2"
 #define RECURSOR
 #ifndef WIN32
 #define GCC_SKIP_LOCKING
index c3d8d46926feb86b1496cdbe353b0ef33723ca04..9b7320a15d0442135d3ce82e3b9ebfa6902dd7f3 100755 (executable)
@@ -1,4 +1,4 @@
-VERSION=3.1.1
+VERSION=3.1.2
 
 INCLUDES="iputils.hh arguments.hh base64.hh zoneparser-tng.hh \
 rcpgenerator.hh lock.hh dnswriter.hh  dnsrecords.hh dnsparser.hh utility.hh \
index 9f08a1804e09b740cef264ba2ab161d033eb648f..f19cc6cfaa51feda33197793890a9df988ddd60d 100644 (file)
@@ -42,7 +42,7 @@ LWRes::LWRes()
   d_sock=-1;
   d_timeout=500000;
   d_bufsize=1500;
-  d_buf=new unsigned char[d_bufsize];
+  d_buf = 0;
 }
 
 LWRes::~LWRes()
@@ -57,6 +57,9 @@ LWRes::~LWRes()
 /** Never throws! */
 int LWRes::asyncresolve(const ComboAddress& ip, const string& domain, int type, bool doTCP, struct timeval* now)
 {
+  if(!d_buf)
+    d_buf=new unsigned char[d_bufsize];
+
   d_ip=ip;
   vector<uint8_t> vpacket;
   DNSPacketWriter pw(vpacket, domain, type);
index 94370393a482ac9e77f37432fb2c83e25cca4713..64450f02b5b1a5b3e1845bdb364be9a1bad4e591 100644 (file)
@@ -2,7 +2,7 @@
 
 Buildroot: /tmp/pdns/
 Name: pdns-recursor
-Version: 3.1.1
+Version: 3.1.2
 Release: 1
 Summary: extremely powerful and versatile recursing nameserver
 Copyright: see /usr/doc/pdns/copyright
index 2335f4542b003bc558e1e84c2677c93ba79736b2..3851fd2dbb260e5b792464f8534f9590e522aaf6 100644 (file)
@@ -103,14 +103,15 @@ void RecordTextReader::xfrLabel(string& val, bool)
   val.clear();
   val.reserve(d_end - d_pos);
 
+  const char* strptr=d_string.c_str();
   while(d_pos < d_end) {
-    if(dns_isspace(d_string[d_pos]))
+    if(dns_isspace(strptr[d_pos]))
       break;
 
-    if(d_string[d_pos]=='\\' && d_pos < d_end - 1) 
+    if(strptr[d_pos]=='\\' && d_pos < d_end - 1) 
       d_pos++;
 
-    val.append(1, d_string[d_pos]);      
+    val.append(1, strptr[d_pos]);      
     d_pos++;
   }
 
@@ -130,7 +131,8 @@ void RecordTextReader::xfrBlob(string& val)
 {
   skipSpaces();
   int pos=(int)d_pos;
-  while(d_pos < d_end && !dns_isspace(d_string[d_pos]))
+  const char* strptr=d_string.c_str();
+  while(d_pos < d_end && !dns_isspace(strptr[d_pos]))
     d_pos++;
 
   string tmp;
@@ -212,7 +214,8 @@ void RecordTextReader::xfrType(uint16_t& val)
 
 void RecordTextReader::skipSpaces()
 {
-  while(d_pos < d_end && dns_isspace(d_string[d_pos]))
+  const char* strptr = d_string.c_str();
+  while(d_pos < d_end && dns_isspace(strptr[d_pos]))
     d_pos++;
   if(d_pos == d_end)
     throw RecordTextException("missing field at the end of record content '"+d_string+"'");