]> granicus.if.org Git - pdns/commit
dnsdist: Fix TCP clients threads vector and counters initialization
authorRemi Gacogne <rgacogne-github@coredump.fr>
Tue, 26 Jan 2016 16:16:12 +0000 (17:16 +0100)
committerRemi Gacogne <rgacogne-github@coredump.fr>
Tue, 26 Jan 2016 16:16:12 +0000 (17:16 +0100)
commita9bf3ec4d0e60f7fd55bcfb7de45816559451225
tree7fbcc50c5b930cbd644b340a80f095b63a81bd68
parentdee7181f1485761dc8b1402eadfb94fed51215be
dnsdist: Fix TCP clients threads vector and counters initialization

By tracking the FD leak reported in #3300, I observed that:
* we could create up to g_maxTCPClientThreads TCP threads,
but the corresponding vector size was hardcoded at 1024
(which the default for g_maxTCPClientThreads)
* the counters were not explicitely initialized

This commit fixes that and adds some additional checks to make
sure we don't add more TCP client threads, as that could lead to
a race if the vector is resized.
pdns/dnsdist-tcp.cc
pdns/dnsdist.cc
pdns/dnsdist.hh