The TCP acceptor, UDP client and Lua network threads never needs to break out of the event loop.
The outgoing DoH one only needs to do that once per second to check for timeouts.
struct timeval tv;
while (true) {
- mplexer->run(&tv);
+ mplexer->run(&tv, -1);
}
}
}
struct timeval tv;
while (true) {
- mplexer->run(&tv);
+ mplexer->run(&tv, -1);
}
}
}
void DownstreamState::handleUDPTimeouts()
{
+ if (getProtocol() != dnsdist::Protocol::DoUDP) {
+ return;
+ }
+
if (s_randomizeIDs) {
auto map = d_idStatesMap.lock();
for (auto it = map->begin(); it != map->end(); ) {
struct timeval now;
while (true) {
- runOnce(now, 5000);
+ runOnce(now, -1);
}
}
time_t lastTimeoutScan = now.tv_sec;
for (;;) {
- data.mplexer->run(&now);
+ data.mplexer->run(&now, 1000);
if (now.tv_sec > lastTimeoutScan) {
lastTimeoutScan = now.tv_sec;