bool g_useTCPSinglePipe{false};
std::atomic<uint16_t> g_downstreamTCPCleanupInterval{60};
-void* tcpClientThread(int pipefd);
+void tcpClientThread(int pipefd);
static void decrementTCPClientCount(const ComboAddress& client)
{
std::shared_ptr<TCPClientCollection> g_tcpclientthreads;
-void* tcpClientThread(int pipefd)
+void tcpClientThread(int pipefd)
{
/* we get launched with a pipe on which we receive file descriptors from clients that we own
from that point on */
lastTCPCleanup = time(nullptr);
}
}
- return 0;
}
/* spawn as many of these as required, they call Accept on a socket on which they will accept queries, and
they will hand off to worker threads & spawn more of them if required
*/
-void* tcpAcceptorThread(void* p)
+void tcpAcceptorThread(void* p)
{
setThreadName("dnsdist/tcpAcce");
ClientState* cs = (ClientState*) p;
}
catch(...){}
}
-
- return 0;
}
}
// listens on a dedicated socket, lobs answers from downstream servers to original requestors
-void* responderThread(std::shared_ptr<DownstreamState> dss)
+void responderThread(std::shared_ptr<DownstreamState> dss)
try {
setThreadName("dnsdist/respond");
auto localRespRulactions = g_resprulactions.getLocal();
vinfolog("Got an error in UDP responder thread while parsing a response from %s, id %d: %s", dss->remote.toStringWithPort(), queryId, e.what());
}
}
- return nullptr;
}
catch(const std::exception& e)
{
errlog("UDP responder thread died because of exception: %s", e.what());
- return nullptr;
}
catch(const PDNSException& e)
{
errlog("UDP responder thread died because of PowerDNS exception: %s", e.reason);
- return nullptr;
}
catch(...)
{
errlog("UDP responder thread died because of an exception: %s", "unknown");
- return nullptr;
}
bool DownstreamState::reconnect()
#endif /* defined(HAVE_RECVMMSG) && defined(HAVE_SENDMMSG) && defined(MSG_WAITFORONE) */
// listens to incoming queries, sends out to downstream servers, noting the intended return path
-static void* udpClientThread(ClientState* cs)
+static void udpClientThread(ClientState* cs)
try
{
setThreadName("dnsdist/udpClie");
processUDPQuery(*cs, holders, &msgh, remote, dest, packet, static_cast<uint16_t>(got), s_udpIncomingBufferSize, nullptr, nullptr, nullptr, nullptr);
}
}
-
- return nullptr;
}
catch(const std::exception &e)
{
errlog("UDP client thread died because of exception: %s", e.what());
- return nullptr;
}
catch(const PDNSException &e)
{
errlog("UDP client thread died because of PowerDNS exception: %s", e.reason);
- return nullptr;
}
catch(...)
{
errlog("UDP client thread died because of an exception: %s", "unknown");
- return nullptr;
}
uint16_t getRandomDNSID()
std::atomic<uint16_t> g_cacheCleaningDelay{60};
std::atomic<uint16_t> g_cacheCleaningPercentage{100};
-void* maintThread()
+void maintThread()
{
setThreadName("dnsdist/main");
int interval = 1;
// ponder pruning g_dynblocks of expired entries here
}
- return nullptr;
}
-static void* secPollThread()
+static void secPollThread()
{
setThreadName("dnsdist/secpoll");
}
sleep(g_secPollInterval);
}
- return 0;
}
-static void* healthChecksThread()
+static void healthChecksThread()
{
setThreadName("dnsdist/healthC");
}
}
}
- return nullptr;
}
static void bindAny(int af, int sock)
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
-void* carbonDumpThread();
+void carbonDumpThread();
uint64_t uptimeOfProcess(const std::string& str);
extern uint16_t g_ECSSourcePrefixV4;
template <class T> using NumberedVector = std::vector<std::pair<unsigned int, T> >;
-void* responderThread(std::shared_ptr<DownstreamState> state);
+void responderThread(std::shared_ptr<DownstreamState> state);
extern std::mutex g_luamutex;
extern LuaContext g_lua;
extern std::string g_outputBuffer; // locking for this is ok, as locked by g_luamutex
void dnsdistWebserverThread(int sock, const ComboAddress& local);
bool getMsgLen32(int fd, uint32_t* len);
bool putMsgLen32(int fd, uint32_t len);
-void* tcpAcceptorThread(void* p);
+void tcpAcceptorThread(void* p);
void setLuaNoSideEffect(); // if nothing has been declared, set that there are no side effects
void setLuaSideEffect(); // set to report a side effect, cancelling all _no_ side effect calls