Skip to content

Commit a3d81a4

Browse files
author
garenwang
committed
6.4.8
1 parent 8862de7 commit a3d81a4

28 files changed

+239
-83
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
# 6.4.8
2+
1、支持下载文件 分块计算crc64。2、支持 HTTPS 双向认证。
3+
14
# 6.4.7
25
1、支持配置HTTP和quic自动切换。
36
2、新增SDK日志导出。
4-
3、支持下载文件 分块计算crc64。
57

68
# 6.4.6
79

Podfile.lock

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
PODS:
22
- GMOpenSSL (2.2.9)
3-
- QCloudCore (6.4.6):
4-
- QCloudCore/Default (= 6.4.6)
5-
- QCloudCore/Default (6.4.6):
6-
- QCloudTrack/Beacon (= 6.4.6)
7-
- QCloudCOSXML (6.4.6):
8-
- QCloudCOSXML/Default (= 6.4.6)
9-
- QCloudCOSXML/Default (6.4.6):
10-
- QCloudCore (= 6.4.6)
11-
- QCloudQuic (6.3.9):
12-
- QCloudQuic/Default (= 6.3.9)
13-
- QCloudQuic/Default (6.3.9)
14-
- QCloudTrack (6.4.6):
15-
- QCloudTrack/Default (= 6.4.6)
16-
- QCloudTrack/Beacon (6.4.6)
17-
- QCloudTrack/Cls (6.4.6):
3+
- QCloudCore (6.4.8):
4+
- QCloudCore/Default (= 6.4.8)
5+
- QCloudCore/Default (6.4.8):
6+
- QCloudTrack/Beacon (= 6.4.8)
7+
- QCloudCOSXML (6.4.8):
8+
- QCloudCOSXML/Default (= 6.4.8)
9+
- QCloudCOSXML/Default (6.4.8):
10+
- QCloudCore (= 6.4.8)
11+
- QCloudQuic (6.4.1):
12+
- QCloudQuic/Default (= 6.4.1)
13+
- QCloudQuic/Default (6.4.1)
14+
- QCloudTrack (6.4.8):
15+
- QCloudTrack/Default (= 6.4.8)
16+
- QCloudTrack/Beacon (6.4.8)
17+
- QCloudTrack/Cls (6.4.8):
1818
- TencentCloudLogProducer
19-
- QCloudTrack/Default (6.4.6)
19+
- QCloudTrack/Default (6.4.8)
2020
- TencentCloudLogProducer (1.1.1):
2121
- TencentCloudLogProducer/Core (= 1.1.1)
2222
- TencentCloudLogProducer/Core (1.1.1):
@@ -47,10 +47,10 @@ EXTERNAL SOURCES:
4747

4848
SPEC CHECKSUMS:
4949
GMOpenSSL: d6d119ff8f00d4e03c2cdf733fb61e98e22da9c7
50-
QCloudCore: de90acb39acb50296e83429bb8b7e6f133234f2b
51-
QCloudCOSXML: 2b34890eab32d3799a1ada7e6ed736443d84027e
52-
QCloudQuic: f7f098de5f6f4ef8de77fc189636867db7e7f301
53-
QCloudTrack: a4de64e5483ec8667032ac08efec64222de42a19
50+
QCloudCore: 11cecc286015fe2efb2a5da52ccdfff9da40e4e7
51+
QCloudCOSXML: 69aa55501c9ff2a3fbfaf2a40558996acb4b3df9
52+
QCloudQuic: a4f2405ccaedde33c36420d4225436b80bd5bf67
53+
QCloudTrack: 6e6f92f8d83afa2d5a42c5e476d68eced20d027f
5454
TencentCloudLogProducer: 564e944491e6396c81df4c9c51470784752ff3ab
5555

5656
PODFILE CHECKSUM: 469848875513aa1180afa1e3751e2d873841a154

QCloudCOSXML.podspec

Lines changed: 5 additions & 5 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.4.7"
5+
s.version = "6.4.8"
66

77

88
s.summary = "QCloudCOSXML 腾讯云iOS-SDK组件"
@@ -21,19 +21,19 @@ s.version = "6.4.7"
2121
s.subspec 'Default' do |default|
2222
default.ios.deployment_target = '10.0'
2323
default.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
24-
default.dependency "QCloudCore",'6.4.7'
24+
default.dependency "QCloudCore",'6.4.8'
2525
end
2626
s.subspec 'Slim' do |slim|
2727
slim.ios.deployment_target = '10.0'
2828
slim.osx.deployment_target = "10.12"
2929
slim.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
30-
slim.dependency "QCloudCore/WithoutMTA",'6.4.7'
30+
slim.dependency "QCloudCore/WithoutMTA",'6.4.8'
3131
end
3232
s.subspec 'Transfer' do |transfer|
3333
transfer.ios.deployment_target = '10.0'
3434
transfer.osx.deployment_target = "10.12"
3535
transfer.source_files = 'QCloudCOSXML/Classes/*','QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/**/*'
36-
transfer.dependency "QCloudCore/WithoutMTA",'6.4.7'
36+
transfer.dependency "QCloudCore/WithoutMTA",'6.4.8'
3737

3838
end
3939

@@ -42,7 +42,7 @@ s.version = "6.4.7"
4242
widget.osx.deployment_target = "10.12"
4343
widget.source_files = 'QCloudCOSXML/Classes/*','QCloudCOSXML/Classes/Transfer/**/*','QCloudCOSXML/Classes/Base/**/*'
4444
widget.exclude_files = 'QCloudCOSXML/Classes/Base/QCloudLogManager.h','QCloudCOSXML/Classes/Base/QCloudLogManager.m'
45-
widget.dependency "QCloudCore/WithoutMTA",'6.4.7'
45+
widget.dependency "QCloudCore/WithoutMTA",'6.4.8'
4646
end
4747

4848
end

QCloudCOSXML/Classes/CI/QCloudCOSXMLService+ImageHelper.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
#import "QCloudPostHashProcessJobsRequest.h"
118118
#import "QCloudUpdateFileProcessQueueRequest.h"
119119
#import "QCloudZipFilePreviewRequest.h"
120-
120+
#import "NSURLRequest+COS.h"
121121

122122
@implementation QCloudCOSXMLService (ImageHelper)
123123

@@ -303,6 +303,7 @@ -(void)buildRequestUrl:(QCloudBizHTTPRequest *)request{
303303

304304
if (request.credential) {
305305
QCloudAuthentationV5Creator *creator = [[QCloudAuthentationV5Creator alloc] initWithCredential:request.credential];
306+
urlRequest.shouldSignedList = request.shouldSignedList;
306307
QCloudSignature *signature = [creator signatureForData:(NSMutableURLRequest *)urlRequest];
307308
NSString *authorizatioinString = signature.signature;
308309
if ([requestURLString hasSuffix:@"&"] || [requestURLString hasSuffix:@"?"]) {
@@ -322,7 +323,7 @@ -(void)buildRequestUrl:(QCloudBizHTTPRequest *)request{
322323
}
323324
return;
324325
}
325-
326+
urlRequest.shouldSignedList = request.shouldSignedList;
326327
[request.signatureProvider signatureWithFields:request.signatureFields
327328
request:request
328329
urlRequest:(NSMutableURLRequest *)urlRequest

QCloudCOSXML/Classes/Manager/QCloudCOSXMLService+Manager.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#import "QCloudGetBucketPolicyRequest.h"
5353
#import "QCloudPutBucketPolicyRequest.h"
5454
#import "QCloudDeleteBucketPolicyRequest.h"
55+
#import "NSURLRequest+COS.h"
5556

5657
@implementation QCloudCOSXMLService (Manager)
5758

@@ -294,6 +295,7 @@ - (void)getPresignedURL:(QCloudGetPresignedURLRequest *)request {
294295

295296
if (request.credential) {
296297
QCloudAuthentationV5Creator *creator = [[QCloudAuthentationV5Creator alloc] initWithCredential:request.credential];
298+
urlRequest.shouldSignedList = request.shouldSignedList;
297299
QCloudSignature *signature = [creator signatureForData:(NSMutableURLRequest *)urlRequest];
298300
NSString *authorizatioinString = signature.signature;
299301
if ([requestURLString hasSuffix:@"&"] || [requestURLString hasSuffix:@"?"]) {
@@ -315,7 +317,7 @@ - (void)getPresignedURL:(QCloudGetPresignedURLRequest *)request {
315317
}
316318
return;
317319
}
318-
320+
urlRequest.shouldSignedList = request.shouldSignedList;
319321
[request.signatureProvider signatureWithFields:request.signatureFields
320322
request:request
321323
urlRequest:(NSMutableURLRequest *)urlRequest

QCloudCOSXML/Classes/QCloudCOSXMLVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#ifndef QCloudCOSXMLModuleVersion_h
77
#define QCloudCOSXMLModuleVersion_h
8-
#define QCloudCOSXMLModuleVersionNumber 604007
8+
#define QCloudCOSXMLModuleVersionNumber 604008
99

1010
//dependency
1111

QCloudCOSXML/Classes/QCloudCOSXMLVersion.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#import "QCloudCOSXMLVersion.h"
2-
NSString * const QCloudCOSXMLModuleVersion = @"6.4.7";
2+
NSString * const QCloudCOSXMLModuleVersion = @"6.4.8";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@end

QCloudCOSXML/Classes/Transfer/request/QCloudCOSXMLDownloadObjectRequest.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
/// 是否使用路径检查,true为开启,false为关闭,默认为true;。
134134
@property (assign, nonatomic) BOOL objectKeySimplifyCheck;
135135

136+
/// 是否开启crc64校验,默认开启。
136137
@property (assign, nonatomic) BOOL enablePartCrc64;
137138

138139
//针对本次下载行流量控制的限速值,必须为数字,单位默认为 bit/s。限速值设置范围为819200 - 838860800,即100KB/s - 100MB/s,如果超出该范围将返回400错误

QCloudCOSXML/Classes/Transfer/request/QCloudCOSXMLDownloadObjectRequest.m

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#define CRC64PartLength 10 * 1024 * 1024
1919

2020
@interface QCloudCOSXMLDownloadObjectRequest()
21+
@property (nonatomic,assign)NSInteger retryCount;
2122
//存储所有的下载请求
2223
@property (nonatomic, strong) NSPointerArray *requestCacheArray;
2324
@property (nonatomic, strong) dispatch_source_t queueSource;
@@ -42,6 +43,7 @@ - (instancetype)init {
4243
if (!self) {
4344
return nil;
4445
}
46+
self.enablePartCrc64 = YES;
4547
self.objectKeySimplifyCheck = YES;
4648
_customHeaders = [NSMutableDictionary dictionary];
4749
_partCrc64Map = [NSMutableDictionary new];
@@ -246,14 +248,6 @@ - (uint64_t)crc64ForFileAtPath:(NSString *)filePath
246248
-(void)loadLocalCrc64{
247249
self.crc64Start = self.localCacheDownloadOffset;
248250
self.crc64Complete = self.crc64Start;
249-
// uint64_t crc64 = [self crc64ForFileAtPath:self.downloadingTempURL.path chunkSize:CRC64PartLength length:0];
250-
// self.crc64Complete = self.crc64Start;
251-
// NSString * range = [NSString stringWithFormat:@"0-%ld",(long)self.crc64Complete];
252-
// [self.partCrc64Map setObject:@(crc64) forKey:range];
253-
// QCloudLogDebugN(@"CRC64", @"calculateCrc64,partRang:%@,crc64:%ld",range,crc64);
254-
// NSData *info =[NSJSONSerialization dataWithJSONObject:[self.partCrc64Map copy] options:NSJSONWritingPrettyPrinted error:nil];
255-
// [info writeToFile:self.partCrc64Filepath options:0 error:nil];
256-
257251
}
258252

259253
- (void)startGetObject {
@@ -380,27 +374,32 @@ - (void)startGetObject {
380374
}
381375
return;
382376
}
377+
QCloudRemoveFileByPath(strongSelf.resumableTaskFile);
383378
uint64_t localCrc64;
384379
if (self.enablePartCrc64 == YES) {
385380
[self calculateCrc64:self.downloadingURL fileSize:0];
386381
localCrc64 = [self mergePartCrc64];
387-
}else{
388-
localCrc64 = [strongSelf crc64ForFileAtPath:strongSelf.downloadingURL.relativePath chunkSize:CRC64PartLength length:0];
389-
}
390-
NSString *localCrc64Str = [NSString stringWithFormat:@"%llu",localCrc64];
391-
QCloudRemoveFileByPath(strongSelf.resumableTaskFile);
392-
QCloudRemoveFileByPath(strongSelf.partCrc64Filepath);
393-
if(![localCrc64Str isEqualToString:dic[@"crc64ecma"]]){
394-
//下载完成之后如果crc64不一致,删除记录文件和已经下载的文件,重新开始下载
395-
if (self.enablePartCrc64 == YES) {
382+
383+
NSString *localCrc64Str = [NSString stringWithFormat:@"%llu",localCrc64];
384+
QCloudRemoveFileByPath(strongSelf.partCrc64Filepath);
385+
if(![localCrc64Str isEqualToString:dic[@"crc64ecma"]]){
386+
//下载完成之后如果crc64不一致,删除记录文件和已经下载的文件,重新开始下载
396387
self.crc64Start = 0;
397388
self.crc64Complete = 0;
398389
self.partCrc64Map = [NSMutableDictionary new];
399390
self.localCacheDownloadOffset = 0;
391+
if (self.retryCount >= 3) {
392+
NSString * message = [NSString stringWithFormat:@"本地文件与远端文件不一致,请重新下载:远端CRC64 值:%@, 本地文件 CRC64值:%@",
393+
dic[@"crc64ecma"], localCrc64Str];
394+
strongSelf.finishBlock(nil, [NSError errorWithDomain:kQCloudNetworkDomain code:QCloudNetworkErrorCodeNotMatch userInfo:@{NSLocalizedDescriptionKey:message}]);
395+
return;
396+
}else{
397+
QCloudRemoveFileByPath(strongSelf.downloadingURL.relativePath);
398+
self.retryCount ++;
399+
[self fakeStart];
400+
}
401+
return;
400402
}
401-
QCloudRemoveFileByPath(strongSelf.downloadingURL.relativePath);
402-
[self fakeStart];
403-
return;
404403
}
405404
if(self.finishBlock){
406405
strongSelf.finishBlock(outputObject, error);

QCloudCOSXMLDemo.xcodeproj/project.pbxproj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@
464464
1AB143E91E601E0500830F93 /* Frameworks */,
465465
1AB143EA1E601E0500830F93 /* Resources */,
466466
5531753F06D2602A23691AE3 /* [CP] Copy Pods Resources */,
467+
963664CB42662B588BB9382D /* [CP] Embed Pods Frameworks */,
467468
);
468469
buildRules = (
469470
);
@@ -600,6 +601,24 @@
600601
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QCloudCOSXMLDemo/Pods-QCloudCOSXMLDemo-resources.sh\"\n";
601602
showEnvVarsInLog = 0;
602603
};
604+
963664CB42662B588BB9382D /* [CP] Embed Pods Frameworks */ = {
605+
isa = PBXShellScriptBuildPhase;
606+
buildActionMask = 2147483647;
607+
files = (
608+
);
609+
inputPaths = (
610+
"${PODS_ROOT}/Target Support Files/Pods-QCloudCOSXMLDemo/Pods-QCloudCOSXMLDemo-frameworks.sh",
611+
"${PODS_ROOT}/../QCloudQuic/Classes/QuicFramework/Tquic.framework",
612+
);
613+
name = "[CP] Embed Pods Frameworks";
614+
outputPaths = (
615+
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Tquic.framework",
616+
);
617+
runOnlyForDeploymentPostprocessing = 0;
618+
shellPath = /bin/sh;
619+
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-QCloudCOSXMLDemo/Pods-QCloudCOSXMLDemo-frameworks.sh\"\n";
620+
showEnvVarsInLog = 0;
621+
};
603622
9985684AE5A7F7B42D827A19 /* [CP] Check Pods Manifest.lock */ = {
604623
isa = PBXShellScriptBuildPhase;
605624
buildActionMask = 2147483647;

0 commit comments

Comments
 (0)