From ecdf6c9965c1fa3a3b2f6e0f52fb8ddbbfe1948b Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sun, 30 Oct 2022 17:57:54 +0530 Subject: [PATCH] CacheZone: minor code refactoring changes. --- DnsServerCore/Dns/Zones/CacheZone.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DnsServerCore/Dns/Zones/CacheZone.cs b/DnsServerCore/Dns/Zones/CacheZone.cs index 9675f2f3..bf896269 100644 --- a/DnsServerCore/Dns/Zones/CacheZone.cs +++ b/DnsServerCore/Dns/Zones/CacheZone.cs @@ -45,7 +45,7 @@ namespace DnsServerCore.Dns.Zones if (record.IsExpired(serveStale)) return Array.Empty(); //RR Set is expired - if (skipSpecialCacheRecord && (record.RDATA is DnsCache.DnsSpecialCacheRecord)) + if (skipSpecialCacheRecord && (record.RDATA is DnsCache.DnsSpecialCacheRecordData)) return Array.Empty(); //RR Set is special cache record } @@ -80,7 +80,7 @@ namespace DnsServerCore.Dns.Zones if (records.Count > 0) { - if (records[0].RDATA is DnsCache.DnsSpecialCacheRecord splRecord) + if (records[0].RDATA is DnsCache.DnsSpecialCacheRecordData splRecord) { if (splRecord.IsFailureOrBadCache) { @@ -89,7 +89,7 @@ namespace DnsServerCore.Dns.Zones if (_entries.TryGetValue(type, out IReadOnlyList existingRecords)) { - if ((existingRecords.Count > 0) && !(existingRecords[0].RDATA is DnsCache.DnsSpecialCacheRecord existingSplRecord && existingSplRecord.IsFailureOrBadCache) && !DnsResourceRecord.IsRRSetExpired(existingRecords, serveStale)) + if ((existingRecords.Count > 0) && !(existingRecords[0].RDATA is DnsCache.DnsSpecialCacheRecordData existingSplRecord && existingSplRecord.IsFailureOrBadCache) && !DnsResourceRecord.IsRRSetExpired(existingRecords, serveStale)) return false; //skip to avoid overwriting a useful record with a failure record } }