]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Move remaining boost:function to std::function
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 28 Mar 2022 15:07:27 +0000 (17:07 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 29 Mar 2022 07:18:14 +0000 (09:18 +0200)
pdns/mtasker.hh
pdns/mtasker_context.hh
pdns/mtasker_fcontext.cc
pdns/mtasker_ucontext.cc
pdns/recursordist/rec-main.cc
pdns/recursordist/rec-main.hh
pdns/statbag.hh
pdns/webserver.hh
pdns/ws-auth.hh
pdns/ws-recursor.hh
pdns/zone2ldap.cc

index 62bf590987e8b25c0af44a7231c745858e8f2cfb..c1806a8241441c93b7e14827390ae927ecf130c1 100644 (file)
@@ -32,7 +32,7 @@
 #include "misc.hh"
 #include "mtasker_context.hh"
 #include <memory>
-#include <boost/function.hpp>
+
 using namespace ::boost::multi_index;
 
 // #define MTASKERTIMING 1
@@ -56,7 +56,7 @@ private:
   struct ThreadInfo
   {
        std::shared_ptr<pdns_ucontext_t> context;
-       boost::function<void(void)> start;
+       std::function<void(void)> start;
        char* startOfStack;
        char* highestStackSeen;
 #ifdef MTASKERTIMING
index 3c1a95b143685196779eedc4ef0b5755bcdf7227..dc98686a01d22177c47e88fe28f42b93090dfb44 100644 (file)
@@ -21,7 +21,6 @@
  */
 #pragma once
 #include "lazy_allocator.hh"
-#include <boost/function.hpp>
 #include <vector>
 #include <exception>
 
@@ -46,7 +45,7 @@ pdns_swapcontext
 
 void
 pdns_makecontext
-(pdns_ucontext_t& ctx, boost::function<void(void)>& start);
+(pdns_ucontext_t& ctx, std::function<void(void)>& start);
 
 #ifdef HAVE_FIBER_SANITIZER
 #include <sanitizer/common_interface_defs.h>
index 72627a7e5ccce979cbe2cbeffbaa59bf1cf46f48..b4aa3a44b3bfe259946479984695e3807ffa2f35 100644 (file)
@@ -92,7 +92,7 @@ struct args_t {
     fcontext_t prev_ctx = nullptr;
 #endif
     pdns_ucontext_t* self = nullptr;
-    boost::function<void(void)>* work = nullptr;
+    std::function<void(void)>* work = nullptr;
 };
 
 extern "C" {
@@ -212,7 +212,7 @@ pdns_swapcontext
 
 void
 pdns_makecontext
-(pdns_ucontext_t& ctx, boost::function<void(void)>& start) {
+(pdns_ucontext_t& ctx, std::function<void(void)>& start) {
     assert (ctx.uc_link);
     assert (ctx.uc_stack.size() >= 8192);
     assert (!ctx.uc_mcontext);
index 2cecc97f4a18b28f3e3291f1a345d5749a95d98f..83d326d4c3d239d928c974f17f486d857796a84d 100644 (file)
@@ -83,7 +83,7 @@ threadWrapper (int const ctx0, int const ctx1, int const fun0, int const fun1) {
     notifyStackSwitchDone();
     auto ctx = joinPtr<pdns_ucontext_t>(ctx0, ctx1);
     try {
-        auto start = std::move(*joinPtr<boost::function<void()>>(fun0, fun1));
+        auto start = std::move(*joinPtr<std::function<void()>>(fun0, fun1));
         start();
     } catch (...) {
         ctx->exception = std::current_exception();
@@ -123,7 +123,7 @@ pdns_swapcontext
 
 void
 pdns_makecontext
-(pdns_ucontext_t& ctx, boost::function<void(void)>& start) {
+(pdns_ucontext_t& ctx, std::function<void(void)>& start) {
     assert (ctx.uc_link);
     assert (ctx.uc_stack.size());
 
index 65c25bdffab4e815af6e90b3e288c6dbd0e85985..ab0e9782910773cae28132ddde002546d86b5f7e 100644 (file)
@@ -1105,7 +1105,7 @@ void broadcastFunction(const pipefunc_t& func)
 }
 
 template <class T>
-void* voider(const boost::function<T*()>& func)
+void* voider(const std::function<T*()>& func)
 {
   return func();
 }
index 89eb0a93d92c47fba21bf09719a2c59774c8fc34..98eb57023e59a70e6a2c8298a638bb233ca15000 100644 (file)
@@ -254,7 +254,7 @@ extern std::set<uint16_t> g_avoidUdpSourcePorts;
 #endif
 
 /* without reuseport, all listeners share the same sockets */
-typedef vector<pair<int, boost::function<void(int, boost::any&)>>> deferredAdd_t;
+typedef vector<pair<int, std::function<void(int, boost::any&)>>> deferredAdd_t;
 extern deferredAdd_t g_deferredAdds;
 
 typedef map<ComboAddress, uint32_t, ComboAddress::addressOnlyLessThan> tcpClientCounts_t;
index acdc3832303b0d09d2a1bb5383b792924be6b909..ee794c1a9d714b87215eedf07508c0a0d242e8f5 100644 (file)
@@ -73,7 +73,7 @@ class StatBag
   map<string, LockGuarded<StatRing<string, CIStringCompare> > > d_rings;
   map<string, LockGuarded<StatRing<SComboAddress> > > d_comboRings;
   map<string, LockGuarded<StatRing<std::tuple<DNSName, QType> > > > d_dnsnameqtyperings;
-  typedef boost::function<uint64_t(const std::string&)> func_t;
+  typedef std::function<uint64_t(const std::string&)> func_t;
   typedef map<string, func_t> funcstats_t;
   funcstats_t d_funcstats;
   bool d_doRings;
index d8707e09149a3c7dcc5b66904b896f015163f04a..16e6df9fbc91757bed87389270bdb83e533ec7e0 100644 (file)
@@ -195,7 +195,7 @@ public:
   void serveConnection(const std::shared_ptr<Socket>& client) const;
   void handleRequest(HttpRequest& request, HttpResponse& resp) const;
 
-  typedef boost::function<void(HttpRequest* req, HttpResponse* resp)> HandlerFunction;
+  typedef std::function<void(HttpRequest* req, HttpResponse* resp)> HandlerFunction;
   void registerApiHandler(const string& url, const HandlerFunction& handler, bool allowPassword=false);
   void registerWebHandler(const string& url, const HandlerFunction& handler);
 
index 9807c2f5e39027a2c0b5f67023fca3d4cc604660..2bbb3f3eb24c73b916bb27f268f606ae985eac19 100644 (file)
@@ -78,7 +78,7 @@ private:
   void indexfunction(HttpRequest* req, HttpResponse* resp);
   void cssfunction(HttpRequest* req, HttpResponse* resp);
   void jsonstat(HttpRequest* req, HttpResponse* resp);
-  void registerApiHandler(const string& url, boost::function<void(HttpRequest*, HttpResponse*)> handler);
+  void registerApiHandler(const string& url, std::function<void(HttpRequest*, HttpResponse*)> handler);
   void printvars(ostringstream &ret);
   void printargs(ostringstream &ret);
   void webThread();
index 0a1a7fde3a3e48bc579c776ab0b63df3fd0c9a69..1389b43f04e33a3943c608876a705ed39b0686a2 100644 (file)
@@ -39,7 +39,7 @@ public:
 
   friend void AsyncServerNewConnectionMT(void* p);
 
-  typedef boost::function<void(std::shared_ptr<Socket>)> newconnectioncb_t;
+  typedef std::function<void(std::shared_ptr<Socket>)> newconnectioncb_t;
   void asyncWaitForConnections(FDMultiplexer* fdm, const newconnectioncb_t& callback);
 
 private:
index 38c3b7e72808be1e262783fdbe0ed1c7d36c40a4..f0c9059778248b4eede1398d37f4c75541904562 100644 (file)
@@ -33,7 +33,6 @@
 #include "arguments.hh"
 #include "bindparserclasses.hh"
 #include "statbag.hh"
-#include <boost/function.hpp>
 #include "dnsrecords.hh"
 #include "misc.hh"
 #include "dns.hh"
@@ -274,7 +273,7 @@ int main( int argc, char* argv[] )
 
                 g_basedn = args["basedn"];
                 g_dnsttl = args.mustDo( "dnsttl" );
-                typedef boost::function<void(unsigned int, const DNSName &, const string &, const string &, int)> callback_t;
+                typedef std::function<void(unsigned int, const DNSName &, const string &, const string &, int)> callback_t;
                 callback_t callback = callback_simple;
                 if( args["layout"] == "tree" )
                 {