From 8df865b6e75fd4ab9da1edb131f215b318ee7f3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E4=B9=9D?= <366193849@qq.com> Date: Thu, 18 Nov 2021 23:15:45 +0800 Subject: [PATCH] =?UTF-8?q?dns=E8=AE=B0=E5=BD=95=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FastGithub.DomainResolve/DomainResolver.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/FastGithub.DomainResolve/DomainResolver.cs b/FastGithub.DomainResolve/DomainResolver.cs index d4ac96f..89e3e03 100644 --- a/FastGithub.DomainResolve/DomainResolver.cs +++ b/FastGithub.DomainResolve/DomainResolver.cs @@ -18,21 +18,21 @@ namespace FastGithub.DomainResolve /// sealed class DomainResolver : IDomainResolver { + private readonly DnsClient dnsClient; + private readonly FastGithubConfig fastGithubConfig; + private readonly ILogger logger; private record EndPointItem(string Host, int Port); + private readonly ConcurrentDictionary dnsEndPointAddressElapseds = new(); + private static readonly string dnsEndpointFile = "dnsendpoints.json"; private static readonly SemaphoreSlim dnsEndpointLocker = new(1, 1); - private static readonly JsonSerializerOptions jsonOptions = new JsonSerializerOptions + private static readonly JsonSerializerOptions jsonOptions = new() { WriteIndented = true, PropertyNameCaseInsensitive = true, PropertyNamingPolicy = JsonNamingPolicy.CamelCase }; - private readonly DnsClient dnsClient; - private readonly FastGithubConfig fastGithubConfig; - private readonly ILogger logger; - private readonly ConcurrentDictionary dnsEndPointAddressElapseds = new(); - /// /// 域名解析器 /// @@ -80,7 +80,7 @@ namespace FastGithub.DomainResolve var dnsEndPoints = new List(); foreach (var item in endPointItems) { - if (this.fastGithubConfig.IsMatch(item.Host)) + if (this.fastGithubConfig.IsMatch(item.Host) == true) { dnsEndPoints.Add(new DnsEndPoint(item.Host, item.Port)); }