]> granicus.if.org Git - pdns/commitdiff
propagate EDNS max packet size through to packetcached answers - closing ticket 200...
authorBert Hubert <bert.hubert@netherlabs.nl>
Sat, 15 Nov 2008 21:51:48 +0000 (21:51 +0000)
committerBert Hubert <bert.hubert@netherlabs.nl>
Sat, 15 Nov 2008 21:51:48 +0000 (21:51 +0000)
git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1281 d19b8d6e-7fed-0310-83ef-9ca221ded41b

pdns/common_startup.cc
pdns/dnspacket.cc
pdns/dnspacket.hh

index 8cd7c453388dbd7ddbd3eabd435b343a3856c759..32fb3b846e0c0979784e250937dfa8d280f8cf17 100644 (file)
@@ -248,6 +248,7 @@ void *qthread(void *p)
       cached.setRemote(&P->remote);  // inlined
       cached.setSocket(P->getSocket());                               // inlined
       cached.spoofID(P->d.id);                                        // inlined 
+      cached.setMaxReplyLen(P->getMaxReplyLen());
       cached.d.rd=P->d.rd; // copy in recursion desired bit 
       cached.commitD(); // commit d to the packet                        inlined
 
index 8a75f84e37255449f18afc9dd82d3f4852363b1c..797d8837ec3860828aca645ce41769e7dcf4a155 100644 (file)
@@ -486,6 +486,11 @@ int DNSPacket::getMaxReplyLen()
   return d_maxreplylen;
 }
 
+void DNSPacket::setMaxReplyLen(int bytes)
+{
+  d_maxreplylen=bytes;
+}
+
 //! Use this to set where this packet was received from or should be sent to
 void DNSPacket::setRemote(const ComboAddress *s)
 {
index 05e43daf50300df838b7bfa6ebec8e3e3258471e..d9d92782040b135c96ed194a380c08ca16ad9f92 100644 (file)
@@ -139,6 +139,7 @@ public:
 
   void commitD(); //!< copies 'd' into the stringbuffer
   int getMaxReplyLen(); //!< retrieve the maximum length of the packet we should send in response
+  void setMaxReplyLen(int bytes); //!< set the max reply len (used when retrieving from the packet cache, and this changed)
 
   bool couldBeCached(); //!< returns 0 if this query should bypass the packet cache