From bfb91642072c08050d3d4cf60a77390dfe5a83bf Mon Sep 17 00:00:00 2001 From: erichuyuehu Date: Mon, 10 Jul 2023 15:35:53 +0800 Subject: [PATCH 1/6] =?UTF-8?q?feat:=E5=A4=84=E7=90=86=E5=8F=8C=E6=A0=88?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSDKDns/Resolver/HttpsDnsResolver.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MSDKDns/Resolver/HttpsDnsResolver.m b/MSDKDns/Resolver/HttpsDnsResolver.m index be55da8..2ab0439 100644 --- a/MSDKDns/Resolver/HttpsDnsResolver.m +++ b/MSDKDns/Resolver/HttpsDnsResolver.m @@ -43,7 +43,7 @@ - (void)startWithDomains:(NSArray *)domains TimeOut:(float)timeOut DnsId:(int)dn id delegate = self.delegate; self.errorCode = MSDKDns_UnResolve; if (!domainStr || domainStr.length == 0) { - MSDKDNSLOG(@"HttpDns Domain is must needed!"); + MSDKDNSLOG(@"HttpDns Domain is must needed!"); self.domainInfo = nil; self.isFinished = YES; self.isSucceed = NO; @@ -266,6 +266,10 @@ - (NSDictionary *)parseAllIPString:(NSString *)iPstring { } } + // 当双栈解析请求中ipv4和ipv6的结果都不符合预期,就返回ni走getDomainError逻辑 + if (bothIPDict.count == 0){ + return nil; + } return bothIPDict; } else { BOOL use4A = false; From ca529cf49e6ffca793dc23a9e0d208c9b9c60462 Mon Sep 17 00:00:00 2001 From: erichuyuehu Date: Thu, 17 Aug 2023 11:28:35 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=8C=81=E4=B9=85?= =?UTF-8?q?=E5=8C=96=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSDKDns/CacheManager/MSDKDnsParamsManager.m | 1 + 1 file changed, 1 insertion(+) diff --git a/MSDKDns/CacheManager/MSDKDnsParamsManager.m b/MSDKDns/CacheManager/MSDKDnsParamsManager.m index 5487e72..5153fc4 100644 --- a/MSDKDns/CacheManager/MSDKDnsParamsManager.m +++ b/MSDKDns/CacheManager/MSDKDnsParamsManager.m @@ -63,6 +63,7 @@ - (id) init { _msdkAddressType = HttpDnsAddressTypeAuto; _enableKeepDomainsAlive = YES; _expiredIPEnabled = NO; + _persistCacheIPEnabled = NO; _enableDetectHostServer = NO; } return self; From 51b68749543bdec7f55857ed71373d897c343661 Mon Sep 17 00:00:00 2001 From: erichuyuehu Date: Thu, 17 Aug 2023 14:30:56 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E4=B8=89=E7=BD=91?= =?UTF-8?q?=E6=8E=A2=E6=B5=8B=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSDKDns/CacheManager/MSDKDnsNetworkManager.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MSDKDns/CacheManager/MSDKDnsNetworkManager.m b/MSDKDns/CacheManager/MSDKDnsNetworkManager.m index 8d2580b..027697f 100644 --- a/MSDKDns/CacheManager/MSDKDnsNetworkManager.m +++ b/MSDKDns/CacheManager/MSDKDnsNetworkManager.m @@ -81,7 +81,7 @@ - (instancetype)init [[MSDKDnsManager shareInstance] switchToMainServer]; BOOL enableDetectHostServer = [[MSDKDnsParamsManager shareInstance] msdkDnsGetEnableDetectHostServer]; - if (!enableDetectHostServer) { + if (enableDetectHostServer) { MSDKDNSLOG(@"Network did changed, detect HttpDns servers"); // 探测dnsIp [[MSDKDnsManager shareInstance] detectHttpDnsServers]; @@ -114,7 +114,7 @@ - (instancetype)init [self getHostsByKeepAliveDomains]; BOOL enableDetectHostServer = [[MSDKDnsParamsManager shareInstance] msdkDnsGetEnableDetectHostServer]; - if (!enableDetectHostServer) { + if (enableDetectHostServer) { // 探测dnsIp [[MSDKDnsManager shareInstance] detectHttpDnsServers]; } From c4827360ea9fd77106654af583f4d12b1d28a7db Mon Sep 17 00:00:00 2001 From: erichuyuehu Date: Mon, 21 Aug 2023 10:58:50 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=B8=85=E9=99=A4=E7=BC=93=E5=AD=98=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSDKDns/CacheManager/MSDKDnsNetworkManager.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/MSDKDns/CacheManager/MSDKDnsNetworkManager.m b/MSDKDns/CacheManager/MSDKDnsNetworkManager.m index 027697f..92532c7 100644 --- a/MSDKDns/CacheManager/MSDKDnsNetworkManager.m +++ b/MSDKDns/CacheManager/MSDKDnsNetworkManager.m @@ -95,11 +95,13 @@ - (instancetype)init usingBlock:^(NSNotification *note) { BOOL expiredIPEnabled = [[MSDKDnsParamsManager shareInstance] msdkDnsGetExpiredIPEnabled]; - if (!expiredIPEnabled) { + BOOL persistCacheIPEnabled = [[MSDKDnsParamsManager shareInstance] msdkDnsGetPersistCacheIPEnabled]; + if (!expiredIPEnabled && !persistCacheIPEnabled) { MSDKDNSLOG(@"Application did enter background,clear MSDKDns cache"); - //进入后台时清除缓存,暂停网络监测 + //进入后台时清除缓存,排除开启了持久化缓存或者开启了使用过期缓存IP的情况 [[MSDKDnsManager shareInstance] clearAllCache]; } + //进入后台时,暂停网络监测 [self.reachability stopNotifier]; }]; From fad83eb12adff9676396738d0f7415254a8d31b4 Mon Sep 17 00:00:00 2001 From: erichuyuehu Date: Tue, 22 Aug 2023 14:12:44 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=BF=AB=E6=89=8B?= =?UTF-8?q?=E9=97=AA=E9=80=80=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSDKDns/CacheManager/MSDKDnsManager.m | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/MSDKDns/CacheManager/MSDKDnsManager.m b/MSDKDns/CacheManager/MSDKDnsManager.m index 7822b6f..0f028bb 100644 --- a/MSDKDns/CacheManager/MSDKDnsManager.m +++ b/MSDKDns/CacheManager/MSDKDnsManager.m @@ -1155,14 +1155,9 @@ - (void)detectHttpDnsServers { } - (NSString *)currentDnsServer { - // int index = self.serverIndex; - // if (index < [[[MSDKDnsParamsManager shareInstance] msdkDnsGetServerIps] count]) { - // return [[[MSDKDnsParamsManager shareInstance] msdkDnsGetServerIps] objectAtIndex:index]; - // } - // return [[MSDKDnsParamsManager shareInstance] msdkDnsGetMDnsIp]; int index = self.serverIndex; - if (index < [self.dnsServers count]) { - return [self.dnsServers objectAtIndex:index]; + if (self.dnsServers != nil && [self.dnsServers count] > 0 && index >= 0 && index < [self.dnsServers count]) { + return self.dnsServers[index]; } return [[self defaultServers] firstObject]; } From 33dcb318e78db9e76d2b0918f8a540b04fd0cf00 Mon Sep 17 00:00:00 2001 From: erichuyuehu Date: Tue, 22 Aug 2023 14:15:45 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feat:=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MSDKDns.xcodeproj/project.pbxproj | 16 ++++++++-------- MSDKDns/MSDKDns.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/MSDKDns.xcodeproj/project.pbxproj b/MSDKDns.xcodeproj/project.pbxproj index 6ba6857..3b2f28c 100644 --- a/MSDKDns.xcodeproj/project.pbxproj +++ b/MSDKDns.xcodeproj/project.pbxproj @@ -1047,7 +1047,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( @@ -1094,7 +1094,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( "-ObjC", @@ -1137,7 +1137,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( @@ -1179,7 +1179,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( "-ObjC", @@ -1228,7 +1228,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( @@ -1276,7 +1276,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( "-ObjC", @@ -1314,7 +1314,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( @@ -1354,7 +1354,7 @@ LINK_WITH_STANDARD_LIBRARIES = NO; MACH_O_TYPE = mh_object; MACOSX_DEPLOYMENT_TARGET = ""; - MARKETING_VERSION = 1.8.0; + MARKETING_VERSION = 1.8.1; OTHER_CFLAGS = "-fembed-bitcode"; OTHER_LDFLAGS = ( "-ObjC", diff --git a/MSDKDns/MSDKDns.h b/MSDKDns/MSDKDns.h index 5b2d547..89b4b41 100644 --- a/MSDKDns/MSDKDns.h +++ b/MSDKDns/MSDKDns.h @@ -5,7 +5,7 @@ #ifndef __MSDKDns_H__ #define __MSDKDns_H__ -#define MSDKDns_Version @"1.8.0" +#define MSDKDns_Version @"1.8.1" #import