From ebcf082a79f5b36210d7191ce461cc3a9384472e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 11 Mar 2015 08:37:20 +0000 Subject: testing/pdns: upgrade to 3.4.3 and cherry-pick patch from upstream --- testing/pdns/allocate-tcp-buffer-dynamically.patch | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 testing/pdns/allocate-tcp-buffer-dynamically.patch (limited to 'testing/pdns/allocate-tcp-buffer-dynamically.patch') diff --git a/testing/pdns/allocate-tcp-buffer-dynamically.patch b/testing/pdns/allocate-tcp-buffer-dynamically.patch new file mode 100644 index 0000000000..b346a2e9a1 --- /dev/null +++ b/testing/pdns/allocate-tcp-buffer-dynamically.patch @@ -0,0 +1,46 @@ +From c2b4ccc0d125a30a1970f555f572bf74de27a3d5 Mon Sep 17 00:00:00 2001 +From: bert hubert +Date: Sat, 10 Jan 2015 23:06:38 +0100 +Subject: [PATCH] allocate TCP buffer dynamically, decreasing our stack usage + +--- + pdns/tcpreceiver.cc | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc +index f90bf90..6356d34 100644 +--- a/pdns/tcpreceiver.cc ++++ b/pdns/tcpreceiver.cc +@@ -253,7 +253,8 @@ void *TCPNameserver::doConnection(void *data) + pthread_detach(pthread_self()); + Utility::setNonBlocking(fd); + try { +- char mesg[65535]; ++ int mesgsize=65535; ++ scoped_array mesg(new char[mesgsize]); + + DLOG(L<<"TCP Connection accepted on fd "<sizeof(mesg)) { ++ if(pktlen > mesgsize) { + L<(new DNSPacket); + packet->setRemote(&remote); + packet->d_tcp=true; + packet->setSocket(fd); +- if(packet->parse(mesg, pktlen)<0) ++ if(packet->parse(mesg.get(), pktlen)<0) + break; + + if(packet->qtype.getCode()==QType::AXFR) { -- cgit v1.2.3