From f7a1d80aebf69e1f89eee6fe9111dff2ab6dbc75 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 18 Mar 2023 13:35:51 +0530 Subject: [PATCH] DnsServerInternal: implemented IDnsClient.ResolveAsync(). --- .../Dns/Applications/DnsServerInternal.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/DnsServerCore/Dns/Applications/DnsServerInternal.cs b/DnsServerCore/Dns/Applications/DnsServerInternal.cs index 836f3f66..225f9156 100644 --- a/DnsServerCore/Dns/Applications/DnsServerInternal.cs +++ b/DnsServerCore/Dns/Applications/DnsServerInternal.cs @@ -19,6 +19,7 @@ along with this program. If not, see . using DnsServerCore.ApplicationCommon; using System; +using System.Threading; using System.Threading.Tasks; using TechnitiumLibrary.Net.Dns; using TechnitiumLibrary.Net.Proxy; @@ -58,18 +59,19 @@ namespace DnsServerCore.Dns.Applications return _dnsServer.DirectQueryAsync(request, timeout, true); } + public Task ResolveAsync(DnsQuestionRecord question, CancellationToken cancellationToken = default) + { + return DirectQueryAsync(question); + } + public void WriteLog(string message) { - LogManager log = _dnsServer.LogManager; - if (log != null) - log.Write("DNS App [" + _applicationName + "]: " + message); + _dnsServer.LogManager?.Write("DNS App [" + _applicationName + "]: " + message); } public void WriteLog(Exception ex) { - LogManager log = _dnsServer.LogManager; - if (log != null) - log.Write("DNS App [" + _applicationName + "]: " + ex.ToString()); + _dnsServer.LogManager?.Write("DNS App [" + _applicationName + "]: " + ex.ToString()); } #endregion