]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
c++20 does not allow implicit capture of this
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Thu, 4 Sep 2025 07:46:27 +0000 (09:46 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 12 Nov 2025 08:09:27 +0000 (09:09 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
pdns/distributor.hh
pdns/webserver.cc

index cdee87b67dc7b33a36cc3dd1a9c940b1e78535d8..fb18019b7d95521cf8b7130fdb7fc3dd8d405a6e 100644 (file)
@@ -173,7 +173,7 @@ template<class Answer, class Question, class Backend>MultiThreadDistributor<Answ
   g_log<<Logger::Warning<<"About to create "<<numberOfThreads<<" backend threads for UDP"<<endl;
 
   for (int distributorIdx = 0; distributorIdx < numberOfThreads; distributorIdx++) {
-    std::thread t([=](){distribute(distributorIdx);});
+    std::thread t([=,this](){distribute(distributorIdx);});
     t.detach();
     Utility::usleep(50000); // we've overloaded mysql in the past :-)
   }
index 334f42356f0e13af8afae077a4d513e990fa6061..e292742ace290ccc457b2e3dc4c975638bc979e2 100644 (file)
@@ -206,7 +206,7 @@ void WebServer::apiWrapper(const WebServer::HandlerFunction& handler, HttpReques
 }
 
 void WebServer::registerApiHandler(const string& url, const HandlerFunction& handler, const std::string& method, bool allowPassword) {
-  auto f = [=](HttpRequest *req, HttpResponse* resp){apiWrapper(handler, req, resp, allowPassword);};
+  auto f = [=,this](HttpRequest *req, HttpResponse* resp){apiWrapper(handler, req, resp, allowPassword);};
   registerBareHandler(url, f, method);
 }
 
@@ -224,7 +224,7 @@ void WebServer::webWrapper(const WebServer::HandlerFunction& handler, HttpReques
 }
 
 void WebServer::registerWebHandler(const string& url, const HandlerFunction& handler, const std::string& method) {
-  auto f = [=](HttpRequest *req, HttpResponse *resp){webWrapper(handler, req, resp);};
+  auto f = [=,this](HttpRequest *req, HttpResponse *resp){webWrapper(handler, req, resp);};
   registerBareHandler(url, f, method);
 }