Skip to content

Commit 5efc8da

Browse files
author
garenwang
committed
fix:优化dns校验
1 parent fd5a5bc commit 5efc8da

File tree

15 files changed

+102
-33
lines changed

15 files changed

+102
-33
lines changed

Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use_frameworks!
55
target 'QCloudCOSXMLDemo' do
66
pod 'QCloudCOSXML', path:'.'
77
pod 'QCloudCore', path:'.'
8+
pod 'QCloudQuic', path:'.'
89

910
target 'QCloudCOSXMLDemoTests' do
1011
inherit! :search_paths

Podfile.lock

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,34 @@
11
PODS:
2-
- QCloudCore (6.1.4):
3-
- QCloudCore/Default (= 6.1.4)
4-
- QCloudCore/Default (6.1.4)
5-
- QCloudCOSXML (6.1.4):
6-
- QCloudCOSXML/Default (= 6.1.4)
7-
- QCloudCOSXML/Default (6.1.4):
8-
- QCloudCore (= 6.1.4)
2+
- QCloudCore (6.2.4):
3+
- QCloudCore/Default (= 6.2.4)
4+
- QCloudCore/Default (6.2.4)
5+
- QCloudCOSXML (6.2.4):
6+
- QCloudCOSXML/Default (= 6.2.4)
7+
- QCloudCOSXML/Default (6.2.4):
8+
- QCloudCore (= 6.2.4)
9+
- QCloudQuic (6.2.4):
10+
- QCloudQuic/Default (= 6.2.4)
11+
- QCloudQuic/Default (6.2.4):
12+
- QCloudCOSXML (= 6.2.4)
913

1014
DEPENDENCIES:
1115
- QCloudCore (from `.`)
1216
- QCloudCOSXML (from `.`)
17+
- QCloudQuic (from `.`)
1318

1419
EXTERNAL SOURCES:
1520
QCloudCore:
1621
:path: "."
1722
QCloudCOSXML:
1823
:path: "."
24+
QCloudQuic:
25+
:path: "."
1926

2027
SPEC CHECKSUMS:
21-
QCloudCore: f02b07282d80787ff99572f67391f9fb6b015a31
22-
QCloudCOSXML: 261cc38f69abeb6901fc831d843b5569c7d26674
28+
QCloudCore: 9e77dfc0afd2a1ad623a6d203fbf5899197ea23a
29+
QCloudCOSXML: 20afbfede77ad27f42ff7b51c12b89d4e026ec06
30+
QCloudQuic: b1a1feb53e602b5c4f5423b9088e0d4b5f37bc73
2331

24-
PODFILE CHECKSUM: 384b99448c6c2fa2f931b43a3eacbd13f1ec5751
32+
PODFILE CHECKSUM: 87053f234f38ae6a394978f26bcb119015f9918e
2533

26-
COCOAPODS: 1.11.3
34+
COCOAPODS: 1.12.1

QCloudCOSXML.podspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pod::Spec.new do |s|
22
s.name = "QCloudCOSXML"
33

44

5-
s.version = "6.2.3"
5+
s.version = "6.2.4"
66

77

88
s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
@@ -22,15 +22,15 @@ s.version = "6.2.3"
2222
s.subspec 'Default' do |default|
2323
default.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
2424

25-
default.dependency "QCloudCore",'6.2.3'
25+
default.dependency "QCloudCore",'6.2.4'
2626
end
2727
s.subspec 'Slim' do |slim|
2828
slim.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
29-
slim.dependency "QCloudCore/WithoutMTA",'6.2.3'
29+
slim.dependency "QCloudCore/WithoutMTA",'6.2.4'
3030
end
3131
s.subspec 'Transfer' do |transfer|
3232
transfer.source_files = 'QCloudCOSXML/Classes/*','QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/**/*'
33-
transfer.dependency "QCloudCore/WithoutMTA",'6.2.3'
33+
transfer.dependency "QCloudCore/WithoutMTA",'6.2.4'
3434

3535
end
3636

QCloudCOSXML/Classes/QCloudCOSXMLVersion.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55

66
#ifndef QCloudCOSXMLModuleVersion_h
77
#define QCloudCOSXMLModuleVersion_h
8-
#define QCloudCOSXMLModuleVersionNumber 602003
8+
#define QCloudCOSXMLModuleVersionNumber 602004
99

1010
//dependency
1111

1212
//
1313
FOUNDATION_EXTERN NSString * const QCloudCOSXMLModuleVersion;
1414
FOUNDATION_EXTERN NSString * const QCloudCOSXMLModuleName;
1515

16-
#endif
16+
#endif

QCloudCOSXML/Classes/QCloudCOSXMLVersion.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "QCloudCOSXMLVersion.h"
2-
NSString * const QCloudCOSXMLModuleVersion = @"6.2.3";
2+
NSString * const QCloudCOSXMLModuleVersion = @"6.2.4";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@end
@@ -26,4 +26,4 @@ + (void) load
2626
#pragma clang diagnostic pop
2727
}
2828
}
29-
@end
29+
@end

QCloudCOSXMLDemo.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@
386386
1AB143E81E601E0500830F93 /* Sources */,
387387
1AB143E91E601E0500830F93 /* Frameworks */,
388388
1AB143EA1E601E0500830F93 /* Resources */,
389+
DCD67776C472EB71B0527419 /* [CP] Embed Pods Frameworks */,
389390
);
390391
buildRules = (
391392
);
@@ -516,6 +517,24 @@
516517
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
517518
showEnvVarsInLog = 0;
518519
};
520+
DCD67776C472EB71B0527419 /* [CP] Embed Pods Frameworks */ = {
521+
isa = PBXShellScriptBuildPhase;
522+
buildActionMask = 2147483647;
523+
files = (
524+
);
525+
inputPaths = (
526+
"${PODS_ROOT}/Target Support Files/Pods-QCloudCOSXMLDemo/Pods-QCloudCOSXMLDemo-frameworks.sh",
527+
"${PODS_ROOT}/../QCloudQuic/Classes/QuicFramework/Tquic.framework",
528+
);
529+
name = "[CP] Embed Pods Frameworks";
530+
outputPaths = (
531+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Tquic.framework",
532+
);
533+
runOnlyForDeploymentPostprocessing = 0;
534+
shellPath = /bin/sh;
535+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QCloudCOSXMLDemo/Pods-QCloudCOSXMLDemo-frameworks.sh\"\n";
536+
showEnvVarsInLog = 0;
537+
};
519538
/* End PBXShellScriptBuildPhase section */
520539

521540
/* Begin PBXSourcesBuildPhase section */
Binary file not shown.

QCloudCOSXMLDemo.xcworkspace/xcuserdata/garenwang.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,38 @@
33
uuid = "165449C0-52F3-40C4-AFF7-66760E7AA713"
44
type = "0"
55
version = "2.0">
6+
<Breakpoints>
7+
<BreakpointProxy
8+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
9+
<BreakpointContent
10+
uuid = "BCF3D2A1-32A1-40EA-9471-0E01F7205DB9"
11+
shouldBeEnabled = "Yes"
12+
ignoreCount = "0"
13+
continueAfterRunningActions = "No"
14+
filePath = "QCloudCore/Classes/Base/QCLOUDRestNet/DNSCache/QCloudHttpDNS.m"
15+
startingColumnNumber = "9223372036854775807"
16+
endingColumnNumber = "9223372036854775807"
17+
startingLineNumber = "226"
18+
endingLineNumber = "226"
19+
landmarkName = "getIPListFromToHost(mHost, mPort)"
20+
landmarkType = "9">
21+
</BreakpointContent>
22+
</BreakpointProxy>
23+
<BreakpointProxy
24+
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
25+
<BreakpointContent
26+
uuid = "2AA966A4-2E82-4BCB-A5E0-2D45F490F8DD"
27+
shouldBeEnabled = "Yes"
28+
ignoreCount = "0"
29+
continueAfterRunningActions = "No"
30+
filePath = "QCloudCore/Classes/Base/QCLOUDRestNet/DNSCache/QCloudHttpDNS.m"
31+
startingColumnNumber = "9223372036854775807"
32+
endingColumnNumber = "9223372036854775807"
33+
startingLineNumber = "253"
34+
endingLineNumber = "253"
35+
landmarkName = "getIPListFromToHost(mHost, mPort)"
36+
landmarkType = "9">
37+
</BreakpointContent>
38+
</BreakpointProxy>
39+
</Breakpoints>
640
</Bucket>

QCloudCore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
1010
s.name = "QCloudCore"
1111

1212

13-
s.version = "6.2.3"
13+
s.version = "6.2.4"
1414

1515

1616

QCloudCore/Classes/Base/QCLOUDRestNet/DNSCache/QCloudHttpDNS.m

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ - (void)prepareFetchIPListForHost:(NSString *)host port:(NSString *)port {
226226
if (res->ai_family == AF_INET6) {
227227
addr6 = (struct sockaddr_in6 *)res->ai_addr;
228228
newChar = inet_ntop(AF_INET6, &addr6->sin6_addr, ipbuf, sizeof(ipbuf));
229+
if(newChar == NULL){
230+
continue;
231+
}
229232
NSString *TempA = [[NSString alloc] initWithCString:(const char *)newChar encoding:NSASCIIStringEncoding];
230233
NSString *TempB = [NSString stringWithUTF8String:IP_ADDR_IPv6.UTF8String];
231234

@@ -234,6 +237,9 @@ - (void)prepareFetchIPListForHost:(NSString *)host port:(NSString *)port {
234237
} else {
235238
addr = (struct sockaddr_in *)res->ai_addr;
236239
newChar = inet_ntop(AF_INET, &addr->sin_addr, ipbuf, sizeof(ipbuf));
240+
if(newChar == NULL){
241+
continue;
242+
}
237243
NSString *TempA = [[NSString alloc] initWithCString:(const char *)newChar encoding:NSASCIIStringEncoding];
238244
NSString *TempB = [NSString stringWithUTF8String:IP_ADDR_IPv4.UTF8String];
239245

@@ -244,8 +250,9 @@ - (void)prepareFetchIPListForHost:(NSString *)host port:(NSString *)port {
244250
QCloudLogInfo(@"host[%s] ipList:%@", mHost, ipList);
245251
}
246252

247-
freeaddrinfo(res0);
248-
253+
if(res0 != NULL){
254+
freeaddrinfo(res0);
255+
}
249256
return ipList;
250257
}
251258
@end

0 commit comments

Comments
 (0)