mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-01-05 08:15:54 +00:00
refactoring done
This commit is contained in:
@@ -292,6 +292,16 @@ namespace DnsServerCore
|
||||
return allRecords.ToArray();
|
||||
}
|
||||
|
||||
private void ListAuthoritativeZones(List<Zone> zones)
|
||||
{
|
||||
DnsResourceRecord[] soa = QueryRecords(DnsResourceRecordType.SOA, true);
|
||||
if (soa != null)
|
||||
zones.Add(this);
|
||||
|
||||
foreach (KeyValuePair<string, Zone> entry in _zones)
|
||||
entry.Value.ListAuthoritativeZones(zones);
|
||||
}
|
||||
|
||||
private void SetRecords(DnsResourceRecordType type, DnsResourceRecord[] records)
|
||||
{
|
||||
_entries.AddOrUpdate(type, records, delegate (DnsResourceRecordType key, DnsResourceRecord[] existingRecords)
|
||||
@@ -500,16 +510,6 @@ namespace DnsServerCore
|
||||
return glueRecords.ToArray();
|
||||
}
|
||||
|
||||
private void GetAuthoritativeZones(List<Zone> zones)
|
||||
{
|
||||
DnsResourceRecord[] soa = QueryRecords(DnsResourceRecordType.SOA, true);
|
||||
if (soa != null)
|
||||
zones.Add(this);
|
||||
|
||||
foreach (KeyValuePair<string, Zone> entry in _zones)
|
||||
entry.Value.GetAuthoritativeZones(zones);
|
||||
}
|
||||
|
||||
private static DnsDatagram QueryAuthoritative(Zone rootZone, DnsDatagram request)
|
||||
{
|
||||
DnsQuestionRecord question = request.Question[0];
|
||||
@@ -929,7 +929,7 @@ namespace DnsServerCore
|
||||
return new ZoneInfo[] { }; //no zone for given domain
|
||||
|
||||
List<Zone> zones = new List<Zone>();
|
||||
currentZone.GetAuthoritativeZones(zones);
|
||||
currentZone.ListAuthoritativeZones(zones);
|
||||
|
||||
List<ZoneInfo> zoneNames = new List<ZoneInfo>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user