带阿里标识的版本

This commit is contained in:
robin
2026-02-28 18:55:33 +08:00
parent 150799f41d
commit 5d0b7c7e91
477 changed files with 10813 additions and 4044 deletions

View File

@@ -52,7 +52,7 @@
@property (nonatomic, setter=setV6TTL:, getter=getV6TTL) int64_t v6ttl;
@property (nonatomic, assign) int64_t lastIPv6LookupTime;
// 用来标记该域名为配置v4记录或v6记录的情况避免如双栈网络下因为某个协议查不到record需要重复请
// 用来标记该域名为配置v4记录或v6记录的情况避免如双栈网络下因为某个协议查不到record需要重复请<EFBFBD><EFBFBD>?
// 这个信息不用持久化一次APP启动周期内使用是合适的
@property (nonatomic, assign) BOOL hasNoIpv4Record;
@property (nonatomic, assign) BOOL hasNoIpv6Record;
@@ -71,8 +71,8 @@
+ (instancetype)fromDBRecord:(HttpdnsHostRecord *)IPRecord;
/**
* 将当前对象转换为数据库记录对
* @return 数据库记录对
* 将当前对象转换为数据库记录对<EFBFBD><EFBFBD>?
* @return 数据库记录对<EFBFBD><EFBFBD>?
*/
- (HttpdnsHostRecord *)toDBRecord;
@@ -83,7 +83,7 @@
/**
* 更新指定IP的connectedRT值并重新排序IP列表
* @param ip 需要更新的IP地址
* @param connectedRT 检测到的RT值-1表示不可
* @param connectedRT 检测到的RT值-1表示不可<EFBFBD><EFBFBD>?
*/
- (void)updateConnectedRT:(NSInteger)connectedRT forIP:(NSString *)ip;

View File

@@ -29,7 +29,7 @@
- (instancetype)init {
if (self = [super init]) {
// connectedRT
// connectedRT<EFBFBD><EFBFBD>?
self.connectedRT = NSIntegerMax;
}
return self;
@@ -129,13 +129,13 @@
- (BOOL)isIpEmptyUnderQueryIpType:(HttpdnsQueryIPType)queryType {
if (queryType & HttpdnsQueryIPTypeIpv4) {
// _hasNoIpv4Recordtrueipv4ip
// _hasNoIpv4Recordtrueipv4ip<EFBFBD><EFBFBD>?
if ([HttpdnsUtil isEmptyArray:[self getV4Ips]] && !_hasNoIpv4Record) {
return YES;
}
} else if (queryType & HttpdnsQueryIPTypeIpv6 && !_hasNoIpv6Record) {
// _hasNoIpv6Recordtrueipv6ip
// _hasNoIpv6Recordtrueipv6ip<EFBFBD><EFBFBD>?
if ([HttpdnsUtil isEmptyArray:[self getV6Ips]] && !_hasNoIpv6Record) {
return YES;
}
@@ -202,14 +202,14 @@
}
- (HttpdnsHostRecord *)toDBRecord {
// IPIP
// IPIP<EFBFBD><EFBFBD>?
NSArray<NSString *> *v4IpStrings = [self getV4IpStrings];
NSArray<NSString *> *v6IpStrings = [self getV6IpStrings];
// modifyAt
NSDate *currentDate = [NSDate date];
// 使hostNamecacheKeyfromDBRecord
// 使hostNamecacheKeyfromDBRecord<EFBFBD><EFBFBD>?
return [[HttpdnsHostRecord alloc] initWithId:0 // ID
cacheKey:self.cacheKey
hostName:self.hostName
@@ -271,17 +271,17 @@
return;
}
// connectedRTIP-1
// connectedRTIP<EFBFBD><EFBFBD>?1<EFBFBD><EFBFBD>?
[mutableIpObjects sortUsingComparator:^NSComparisonResult(HttpdnsIpObject *obj1, HttpdnsIpObject *obj2) {
// obj1connectedRT-1
// obj1connectedRT<EFBFBD><EFBFBD>?1<EFBFBD><EFBFBD>?
if (obj1.connectedRT == -1) {
return NSOrderedDescending;
}
// obj2connectedRT-1
// obj2connectedRT<EFBFBD><EFBFBD>?1<EFBFBD><EFBFBD>?
if (obj2.connectedRT == -1) {
return NSOrderedAscending;
}
// connectedRT
// connectedRT<EFBFBD><EFBFBD>?
return obj1.connectedRT > obj2.connectedRT ? NSOrderedDescending : (obj1.connectedRT < obj2.connectedRT ? NSOrderedAscending : NSOrderedSame);
}];

View File

@@ -1,9 +1,9 @@
//
// HttpdnsHostRecord.h
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by ElonChan地风 on 2017/5/3.
// Copyright © 2017年 alibaba-inc.com. All rights reserved.
// Copyright © 2017<EFBFBD><EFBFBD>?trustapp.com. All rights reserved.
//
#import <Foundation/Foundation.h>

View File

@@ -1,9 +1,9 @@
//
// HttpdnsHostRecord.m
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by ElonChan on 2017/5/3.
// Copyright © 2017 alibaba-inc.com. All rights reserved.
// Copyright © 2017<EFBFBD><EFBFBD>?trustapp.com. All rights reserved.
//
#import "HttpdnsHostRecord.h"

View File

@@ -1,23 +1,23 @@
//
// HttpdnsRequest.h
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by xuyecan on 2024/5/19.
// Copyright © 2024 alibaba-inc.com. All rights reserved.
// Copyright © 2024 trustapp.com. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
#ifndef ALICLOUDHTTPDNSQUERYIPTYPE
#define ALICLOUDHTTPDNSQUERYIPTYPE
#ifndef TrustHTTPDNSQUERYIPTYPE
#define TrustHTTPDNSQUERYIPTYPE
typedef enum {
AlicloudHttpDNS_IPTypeV4 = 0, //ipv4
AlicloudHttpDNS_IPTypeV6 = 1, //ipv6
AlicloudHttpDNS_IPTypeV64 = 2, //ipv4 + ipv6
} AlicloudHttpDNS_IPType;
TrustHttpDNS_IPTypeV4 = 0, //ipv4
TrustHttpDNS_IPTypeV6 = 1, //ipv6
TrustHttpDNS_IPTypeV64 = 2, //ipv4 + ipv6
} TrustHttpDNS_IPType;
typedef NS_OPTIONS(NSUInteger, HttpdnsQueryIPType) {
HttpdnsQueryIPTypeAuto NS_SWIFT_NAME(auto) = 0,
@@ -33,15 +33,15 @@ typedef NS_OPTIONS(NSUInteger, HttpdnsQueryIPType) {
/// 需要解析的域名
@property (nonatomic, copy) NSString *host;
/// 解析超时时间,对于同步接口,即为最大等待时间,对于异步接口,即为最大等待回调时
/// 默认值2取值必须在0.5- 5秒之
/// 解析超时时间,对于同步接口,即为最大等待时间,对于异步接口,即为最大等待回调时<EFBFBD><EFBFBD>?
/// 默认<EFBFBD><EFBFBD>?取值必须在0.5<EFBFBD><EFBFBD>?- 5秒之<EFBFBD><EFBFBD>?
@property (nonatomic, assign) double resolveTimeoutInSecond;
/// 查询IP类型
/// 默认为HttpdnsQueryIPTypeAuto此类型下SDK至少会请求解析ipv4地址若判断到当前网络环境支持ipv6则还会请求解析ipv6地址
/// HttpdnsQueryIPTypeIpv4只请求解析ipv4
/// HttpdnsQueryIPTypeIpv6只请求解析ipv6
/// HttpdnsQueryIPTypeBoth不管当前网络环境是什么会尝试同时请求解析ipv4地址和ipv6地址这种用法通常需要拿到结果之后自行判断网络环境决定使用哪个结
/// HttpdnsQueryIPTypeBoth不管当前网络环境是什么会尝试同时请求解析ipv4地址和ipv6地址这种用法通常需要拿到结果之后自行判断网络环境决定使用哪个结<EFBFBD><EFBFBD>?
@property (nonatomic, assign) HttpdnsQueryIPType queryIpType;
/// SDNS参数针对软件自定义解析场景使用

View File

@@ -1,9 +1,9 @@
//
// HttpdnsRequest.m
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by xuyecan on 2024/5/19.
// Copyright © 2024 alibaba-inc.com. All rights reserved.
// Copyright © 2024 trustapp.com. All rights reserved.
//
#import "HttpdnsRequest.h"
@@ -65,7 +65,7 @@ static double const RESOLVE_HOST_MAX_TIMEOUT_IN_SEC = 5;
} else if (_resolveTimeoutInSecond > RESOLVE_HOST_MAX_TIMEOUT_IN_SEC) {
_resolveTimeoutInSecond = RESOLVE_HOST_MAX_TIMEOUT_IN_SEC;
} else {
//
// <EFBFBD><EFBFBD>?
}
}

View File

@@ -1,9 +1,9 @@
//
// HttpdnsRequest_Internal.h
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by xuyecan on 2024/6/19.
// Copyright © 2024 alibaba-inc.com. All rights reserved.
// Copyright © 2024 trustapp.com. All rights reserved.
//
#ifndef HttpdnsRequest_Internal_h

View File

@@ -1,9 +1,9 @@
//
// HttpdnsResult.h
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by xuyecan on 2024/5/15.
// Copyright © 2024 alibaba-inc.com. All rights reserved.
// Copyright © 2024 trustapp.com. All rights reserved.
//
#import <Foundation/Foundation.h>

View File

@@ -1,9 +1,9 @@
//
// HttpdnsResult.m
// AlicloudHttpDNS
// TrustHttpDNS
//
// Created by xuyecan on 2024/5/15.
// Copyright © 2024 alibaba-inc.com. All rights reserved.
// Copyright © 2024 trustapp.com. All rights reserved.
//
#import "HttpdnsResult.h"