]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make sure we always compile with BOOST_CB_ENABLE_DEBUG set to 0
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 11 Jul 2019 15:09:05 +0000 (17:09 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Wed, 7 Aug 2019 09:23:22 +0000 (11:23 +0200)
(cherry picked from commit 9f6a31fffe1f4bd77fd402f997a5f37a58f72fc5)

13 files changed:
pdns/Makefile.am
pdns/circular_buffer.hh [new file with mode: 0644]
pdns/dnsdist-rings.hh
pdns/dnsdist.hh
pdns/dnsdistdist/Makefile.am
pdns/dnsdistdist/circular_buffer.hh [new symlink]
pdns/dnsdistdist/tcpiohandler.cc
pdns/recursordist/Makefile.am
pdns/recursordist/circular_buffer.hh [new symlink]
pdns/remote_logger.hh
pdns/statbag.hh
pdns/syncres.hh
pdns/ws-api.cc

index 221ef099027db2a9f579f36c0c5c20939d737109..2b7c3045dbc4e39ff5f1ba82ef030006c7914f58 100644 (file)
@@ -160,6 +160,7 @@ pdns_server_SOURCES = \
        bindlexer.l \
        bindparser.cc \
        cachecleaner.hh \
+       circular_buffer.hh \
        comment.hh \
        common_startup.cc common_startup.hh \
        communicator.cc communicator.hh \
@@ -295,6 +296,7 @@ pdnsutil_SOURCES = \
        bindlexer.l \
        bindparser.yy \
        cachecleaner.hh \
+       circular_buffer.hh \
        dbdnsseckeeper.cc \
        dnsbackend.cc \
        dns.cc \
diff --git a/pdns/circular_buffer.hh b/pdns/circular_buffer.hh
new file mode 100644 (file)
index 0000000..f9607f8
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * This file is part of PowerDNS or dnsdist.
+ * Copyright -- PowerDNS.COM B.V. and its contributors
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of version 2 of the GNU General Public License as
+ * published by the Free Software Foundation.
+ *
+ * In addition, for the avoidance of any doubt, permission is granted to
+ * link this program with OpenSSL and to (re)distribute the binaries
+ * produced as the result of such linking.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+#pragma once
+
+#ifndef BOOST_CB_ENABLE_DEBUG
+#define BOOST_CB_ENABLE_DEBUG 0
+#endif
+
+#if BOOST_CB_ENABLE_DEBUG
+// https://github.com/boostorg/circular_buffer/pull/9
+// https://svn.boost.org/trac10/ticket/6277
+#error Building with BOOST_CB_ENABLE_DEBUG prevents accessing a boost::circular_buffer from two threads at once
+#endif /* BOOST_CB_ENABLE_DEBUG */
+
+#include <boost/circular_buffer.hpp>
index a773ed6e96ba2e1172405be87f0def959e6fb070..8a3e089d5cfdad3cd1ccc936c2bfef074f33ba7c 100644 (file)
@@ -25,9 +25,9 @@
 #include <time.h>
 #include <unordered_map>
 
-#include <boost/circular_buffer.hpp>
 #include <boost/variant.hpp>
 
+#include "circular_buffer.hh"
 #include "dnsname.hh"
 #include "iputils.hh"
 
index a96a87b439d17ff920bc7e65eb0ae8d642b9eb99..389d9109991ca401dc4e250fb4489f0d60d17926 100644 (file)
 #include <unistd.h>
 #include <unordered_map>
 
-#include <boost/circular_buffer.hpp>
 #include <boost/variant.hpp>
 
 #include "bpf-filter.hh"
 #include "capabilities.hh"
+#include "circular_buffer.hh"
 #include "dnscrypt.hh"
 #include "dnsdist-cache.hh"
 #include "dnsdist-dynbpf.hh"
index 2112afa53e4ebdb14dac3a8ccea60cbd1774493e..ae22d8d95120b45347a1e635c73fc6f92a905482 100644 (file)
@@ -103,6 +103,7 @@ dnsdist_SOURCES = \
        bpf-filter.cc bpf-filter.hh \
        cachecleaner.hh \
        capabilities.cc capabilities.hh \
+       circular_buffer.hh \
        dns.cc dns.hh \
        dnscrypt.cc dnscrypt.hh \
        dnsdist.cc dnsdist.hh \
@@ -253,9 +254,11 @@ testrunner_SOURCES = \
        test-iputils_hh.cc \
        test-mplexer.cc \
        cachecleaner.hh \
+       circular_buffer.hh \
        dnsdist.hh \
        dnsdist-cache.cc dnsdist-cache.hh \
        dnsdist-ecs.cc dnsdist-ecs.hh \
+       dnsdist-rings.hh \
        dnsdist-xpf.cc dnsdist-xpf.hh \
        dnscrypt.cc dnscrypt.hh \
        dnslabeltext.cc \
diff --git a/pdns/dnsdistdist/circular_buffer.hh b/pdns/dnsdistdist/circular_buffer.hh
new file mode 120000 (symlink)
index 0000000..b0b7895
--- /dev/null
@@ -0,0 +1 @@
+../circular_buffer.hh
\ No newline at end of file
index 959648134f2d7a3f201485ad1cfba86fbde0b825..9c25fea0f5937adb005f7df64b70374f9f6e12b2 100644 (file)
@@ -1,6 +1,7 @@
 #include <fstream>
 
 #include "config.h"
+#include "circular_buffer.hh"
 #include "dolog.hh"
 #include "iputils.hh"
 #include "lock.hh"
@@ -17,8 +18,6 @@
 #include <openssl/rand.h>
 #include <openssl/ssl.h>
 
-#include <boost/circular_buffer.hpp>
-
 #include "libssl.hh"
 
 /* From rfc5077 Section 4. Recommended Ticket Construction */
index 12d93f680fd8040b3b8f54757be5ebd3a7d334ca..092a8c60d33b173cd8c6b4401f9dd5be44776641 100644 (file)
@@ -100,6 +100,7 @@ pdns_recursor_SOURCES = \
        base64.cc base64.hh \
        cachecleaner.hh \
        capabilities.cc capabilities.hh \
+       circular_buffer.hh \
        comment.hh \
        dns.hh dns.cc \
        dns_random.hh dns_random.cc \
@@ -218,6 +219,7 @@ testrunner_SOURCES = \
        arguments.cc \
        base32.cc \
        base64.cc base64.hh \
+       circular_buffer.hh \
        dns.cc dns.hh \
        dns_random.cc dns_random.hh \
        dnslabeltext.cc \
diff --git a/pdns/recursordist/circular_buffer.hh b/pdns/recursordist/circular_buffer.hh
new file mode 120000 (symlink)
index 0000000..b0b7895
--- /dev/null
@@ -0,0 +1 @@
+../circular_buffer.hh
\ No newline at end of file
index 95fd634def3c69b2f27d305abccbd4c65631cbf7..a350729ad4a29ae0ca9752dce1351b0bf2a8564c 100644 (file)
@@ -30,7 +30,7 @@
 #include <thread>
 
 #include "iputils.hh"
-#include <boost/circular_buffer.hpp>
+#include "circular_buffer.hh"
 
 /* Writes can be submitted and they are atomically accepted. Either the whole write
    ends up in the buffer or nothing ends up in the buffer.
index f36c211f636f886096f9a779a662c908c2f2cc6e..a9839693f26ce4af49d4a7bd1fac9e44430ba5f1 100644 (file)
@@ -29,7 +29,7 @@
 #include "lock.hh"
 #include "namespaces.hh"
 #include "iputils.hh"
-#include <boost/circular_buffer.hpp>
+#include "circular_buffer.hh"
 
 
 
index 58390eca6b8061a86f454bc45d2623ef9bb809e0..1a52e7abb99f1b95b8918f03cfb227c4b497644c 100644 (file)
@@ -35,8 +35,8 @@
 #include "misc.hh"
 #include "lwres.hh"
 #include <boost/optional.hpp>
-#include <boost/circular_buffer.hpp>
 #include <boost/utility.hpp>
+#include "circular_buffer.hh"
 #include "sstuff.hh"
 #include "recursor_cache.hh"
 #include "recpacketcache.hh"
index ae62d7dd7f02b9381cd394b1b4c9b707864edad6..54dde00791283a1525a55aec8e4e94d5f73db71d 100644 (file)
@@ -24,7 +24,6 @@
 #endif
 
 #include <boost/tokenizer.hpp>
-#include <boost/circular_buffer.hpp>
 #include "namespaces.hh"
 #include "ws-api.hh"
 #include "json.hh"