mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
DNS_Mgr: Use Process() for timeout expiration
DNS_Mgr has a GetNextTimeout() implementation that may return 0.0. When that is the case, its IO source is enqueued as ready with an fd of -1. This in turn results in Process() being called instead of ProcessFd() in RunState.cc. Ensure timeouts behavior is properly handled by actually forwarding timeout indications to c-ares via DNS_Mgr::Process(). This results in pending DNS queries for which a timeout happened to actually timeout (when there's no other connectivity).
This commit is contained in:
parent
62c06f7e3a
commit
a57c45428f
2 changed files with 10 additions and 1 deletions
|
@ -1471,6 +1471,15 @@ void DNS_Mgr::ProcessFd(int fd, int flags)
|
|||
IssueAsyncRequests();
|
||||
}
|
||||
|
||||
void DNS_Mgr::Process()
|
||||
{
|
||||
// Process() is called when DNS_Mgr is found "ready" when its
|
||||
// GetNextTimeout() returns 0.0, but there's no active FD.
|
||||
//
|
||||
// Kick off timeouts at least.
|
||||
ares_process_fd(channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);
|
||||
}
|
||||
|
||||
void DNS_Mgr::GetStats(Stats* stats)
|
||||
{
|
||||
// TODO: can this use the telemetry framework?
|
||||
|
|
|
@ -285,7 +285,7 @@ protected:
|
|||
void IssueAsyncRequests();
|
||||
|
||||
// IOSource interface.
|
||||
void Process() override { }
|
||||
void Process() override;
|
||||
void ProcessFd(int fd, int flags) override;
|
||||
void InitSource() override;
|
||||
const char* Tag() override { return "DNS_Mgr"; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue