From 1361a78ae7994a6718b59a901f46bdd5167348f5 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 23 Apr 2023 16:09:09 +0530 Subject: [PATCH] DnsServerInternal: updated code to return new cache object to skip authoritative request handler calls. --- DnsServerCore/Dns/Applications/DnsServerInternal.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DnsServerCore/Dns/Applications/DnsServerInternal.cs b/DnsServerCore/Dns/Applications/DnsServerInternal.cs index 225f9156..6ac59121 100644 --- a/DnsServerCore/Dns/Applications/DnsServerInternal.cs +++ b/DnsServerCore/Dns/Applications/DnsServerInternal.cs @@ -34,6 +34,8 @@ namespace DnsServerCore.Dns.Applications readonly string _applicationName; readonly string _applicationFolder; + IDnsCache _dnsCache; + #endregion #region constructor @@ -88,7 +90,15 @@ namespace DnsServerCore.Dns.Applications { get { return _dnsServer.ServerDomain; } } public IDnsCache DnsCache - { get { return _dnsServer.DnsCache; } } + { + get + { + if (_dnsCache is null) + _dnsCache = new ResolverDnsCache(_dnsServer.DnsApplicationManager, _dnsServer.AuthZoneManager, _dnsServer.CacheZoneManager, _dnsServer.LogManager, true); + + return _dnsCache; + } + } public NetProxy Proxy { get { return _dnsServer.Proxy; } }