DnsServerInternal: updated code for new implementation changes. Minor refactoring done.

This commit is contained in:
Shreyas Zare
2021-09-11 13:29:14 +05:30
parent 81e14e3724
commit dc2341a6dc

View File

@@ -30,47 +30,56 @@ namespace DnsServerCore.Dns.Applications
#region variables
readonly DnsServer _dnsServer;
readonly string _appName;
readonly string _applicationName;
readonly string _applicationFolder;
#endregion
#region constructor
public DnsServerInternal(DnsServer dnsServer, string appName, string applicationFolder)
public DnsServerInternal(DnsServer dnsServer, string applicationName, string applicationFolder)
{
_dnsServer = dnsServer;
_appName = appName;
_applicationName = applicationName;
_applicationFolder = applicationFolder;
}
#endregion
#region public
public Task<DnsDatagram> DirectQueryAsync(DnsQuestionRecord question)
{
return _dnsServer.DirectQueryAsync(question);
return _dnsServer.DirectQueryAsync(question, true);
}
public void WriteLog(string message)
{
LogManager log = _dnsServer.LogManager;
if (log != null)
log.Write("DNS App [" + _appName + "]: " + message);
log.Write("DNS App [" + _applicationName + "]: " + message);
}
public void WriteLog(Exception ex)
{
LogManager log = _dnsServer.LogManager;
if (log != null)
log.Write("DNS App [" + _appName + "]: " + ex.ToString());
log.Write("DNS App [" + _applicationName + "]: " + ex.ToString());
}
public string ServerDomain
{ get { return _dnsServer.ServerDomain; } }
#endregion
#region properties
public string ApplicationName
{ get { return _applicationName; } }
public string ApplicationFolder
{ get { return _applicationFolder; } }
public string ServerDomain
{ get { return _dnsServer.ServerDomain; } }
public IDnsCache DnsCache
{ get { return _dnsServer.DnsCache; } }
@@ -79,5 +88,7 @@ namespace DnsServerCore.Dns.Applications
public bool PreferIPv6
{ get { return _dnsServer.PreferIPv6; } }
#endregion
}
}