Skip to content

Commit ae64725

Browse files
author
garenwang
committed
# 6.1.0
1 parent 4990d25 commit ae64725

File tree

12 files changed

+89
-62
lines changed

12 files changed

+89
-62
lines changed

CHANGELOG.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
# 6.0.9
1+
# 6.1.0
22

3-
1.新增内容审核接口
3+
4+
# 6.0.9
45

6+
1.新增内容审核接口
7+
58
# 6.0.8
69

710
1.修改sdk与yymodel 方法命名冲突。2.修改一些SDK 内部一些警告
811

912
# 6.0.7
1013

1114
优化QCloudCore
12-
13-
# 6.0.6
14-
15-
修改sdkdonwlaodbug
16-
15+
1716
# 6.0.5
1817

1918
修改已知bug
19+
20+
# 6.0.5
21+
2022
QCloudQuic 增加 Slim subspec
2123

2224
# 6.0.4

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.0.9"
5+
s.version = "6.1.0"
66

77

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

25-
default.dependency "QCloudCore",'6.0.9'
25+
default.dependency "QCloudCore",'6.1.0'
2626
end
2727
s.subspec 'Slim' do |slim|
2828
slim.source_files = 'QCloudCOSXML/Classes/**/*','QCloudCOSXML/Classes/QCloudCOSXML/*'
29-
slim.dependency "QCloudCore/WithoutMTA",'6.0.9'
29+
slim.dependency "QCloudCore/WithoutMTA",'6.1.0'
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.0.9'
33+
transfer.dependency "QCloudCore/WithoutMTA",'6.1.0'
3434

3535
end
3636

QCloudCOSXML/Classes/Base/QCloudCOSXMLService.h

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ NS_ASSUME_NONNULL_BEGIN
8282
/// @param key 要获取的cosxml服务对应的key
8383
+ (QCloudCOSXMLService *)cosxmlServiceForKey:(NSString *)key;
8484
#pragma hidden super selectors
85-
/**
86-
检查是否存在key对应的service
87-
88-
@param key key
89-
@return 存在与否
90-
91-
*/
92-
+ (BOOL)hasServiceForKey:(NSString *)key;
9385

9486
/// 注册默认的cosxml服务
9587
/// @param configuration cosxml服务对应的配置信息,一旦配置之后无法修改
@@ -100,7 +92,14 @@ NS_ASSUME_NONNULL_BEGIN
10092
/// @param key 该cosxml对应的key
10193
+ (QCloudCOSXMLService *)registerCOSXMLWithConfiguration:(QCloudServiceConfiguration *)configuration withKey:(NSString *)key;
10294

103-
+ (void)removeCOSXMLWithKey:(NSString *)key;
95+
/// 检查是否存在key对应的service
96+
+ (BOOL)hasCosxmlServiceForKey:(NSString *)key;
97+
+ (BOOL)hasServiceForKey:(NSString *)key __attribute__((deprecated("该方法过期,请用hasCosxmlServiceForKey:替换")));
98+
99+
/// 删除可以对应的service
100+
+ (void)removeCosxmlServiceWithKey:(NSString *)key;
101+
+ (void)removeCOSXMLWithKey:(NSString *)key __attribute__((deprecated("该方法过期,请用removeCosxmlServiceWithKey:替换")));
102+
104103

105104
/**
106105
根据Bukcet, Object来生成可以直接访问的URL。如果您的Bucket是私有读的话,那么访问的时候需要带上签名,

QCloudCOSXML/Classes/Base/QCloudCOSXMLService.m

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
4444
return CloudcosxmlService;
4545
}
4646
@implementation QCloudCOSXMLService
47-
@synthesize sessionManager = _sessionManager;
4847
static QCloudCOSXMLService *COSXMLService = nil;
4948

5049
+ (QCloudCOSXMLService *)defaultCOSXML {
@@ -58,13 +57,6 @@ + (QCloudCOSXMLService *)defaultCOSXML {
5857

5958
+ (QCloudCOSXMLService *)registerDefaultCOSXMLWithConfiguration:(QCloudServiceConfiguration *)configuration {
6059
@synchronized(self) {
61-
if (COSXMLService) {
62-
@throw [NSException
63-
exceptionWithName:QCloudErrorDomain
64-
reason:[NSString stringWithFormat:
65-
@"默认的COSXMLService已存在,如有新的配置,请通过 registerCOSXMLWithConfiguration:withKey:重新注册"]
66-
userInfo:nil];
67-
}
6860
COSXMLService = [[QCloudCOSXMLService alloc] initWithConfiguration:configuration];
6961
if (!configuration.isCloseShareLog) {
7062
#if TARGET_OS_IOS
@@ -85,20 +77,8 @@ + (QCloudCOSXMLService *)cosxmlServiceForKey:(NSString *)key {
8577
return cosxmlService;
8678
}
8779

88-
+ (void)removeCOSXMLWithKey:(NSString *)key {
89-
[QCloudCOSXMLServiceCache() removeObjectForKey:key];
90-
}
91-
9280
+ (QCloudCOSXMLService *)registerCOSXMLWithConfiguration:(QCloudServiceConfiguration *)configuration withKey:(NSString *)key;
9381
{
94-
if ([self hasServiceForKey:key]) {
95-
@throw [NSException
96-
exceptionWithName:QCloudErrorDomain
97-
reason:[NSString
98-
stringWithFormat:
99-
@"key: %@ COSXMLService已存在,如有新的配置,请通过 registerCOSXMLWithConfiguration:withKey:重新注册", key]
100-
userInfo:nil];
101-
}
10282
QCloudCOSXMLService *cosxmlService = [[QCloudCOSXMLService alloc] initWithConfiguration:configuration];
10383
[QCloudCOSXMLServiceCache() setObject:cosxmlService forKey:key];
10484
return cosxmlService;
@@ -133,12 +113,22 @@ - (NSString *)getURLWithBucket:(NSString *)bucket
133113
return [resultURL copy];
134114
}
135115

136-
+ (BOOL)hasServiceForKey:(NSString *)key {
116+
+ (BOOL)hasCosxmlServiceForKey:(NSString *)key {
137117
if (nil == [QCloudCOSXMLServiceCache() objectForKey:key]) {
138118
return NO;
139119
} else {
140120
return YES;
141121
}
142122
}
123+
+ (BOOL)hasServiceForKey:(NSString *)key{
124+
return [QCloudCOSXMLService hasCosxmlServiceForKey:key];
125+
}
126+
127+
+ (void)removeCosxmlServiceWithKey:(NSString *)key {
128+
[QCloudCOSXMLServiceCache() removeObjectForKey:key];
129+
}
130+
+ (void)removeCOSXMLWithKey:(NSString *)key{
131+
[self removeCosxmlServiceWithKey:key];
132+
}
143133

144134
@end

QCloudCOSXML/Classes/Transfer/QCloudCOSTransferMangerService.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,11 @@ NS_ASSUME_NONNULL_BEGIN
5555
- (void)CopyObject:(QCloudCOSXMLCopyObjectRequest *)copy;
5656
- (void)DownloadObject:(QCloudCOSXMLDownloadObjectRequest *)get;
5757

58+
59+
/// 是否注册了该key对应的服务
60+
+ (BOOL)hasTransferMangerServiceForKey:(NSString *)key;
61+
62+
/// 删除key对应的服务
63+
+ (void)removeTransferMangerServiceWithKey:(NSString *)key;
5864
@end
5965
NS_ASSUME_NONNULL_END

QCloudCOSXML/Classes/Transfer/QCloudCOSTransferMangerService.m

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,17 @@ - (void)DownloadObject:(QCloudCOSXMLDownloadObjectRequest *)request {
124124
[self.uploadFileQueue addOpreation:operation];
125125
}
126126
#pragma mark - UIApplicationDelegate interceptor
127-
/**
128-
This method needs to be called in the `- application:handleEventsForBackgroundURLSession:completionHandler:` application delegate.
129-
@param application The singleton app object.
130-
@param identifier The identifier of the URL session requiring attention.
131-
@param completionHandler The completion handler to call when you finish processing the events.
132-
*/
127+
128+
+ (BOOL)hasTransferMangerServiceForKey:(NSString *)key {
129+
if (nil == [QCloudCOSTransferMangerServiceCache() objectForKey:key]) {
130+
return NO;
131+
} else {
132+
return YES;
133+
}
134+
}
135+
136+
+ (void)removeTransferMangerServiceWithKey:(NSString *)key {
137+
[QCloudCOSTransferMangerServiceCache() removeObjectForKey:key];
138+
}
133139

134140
@end

QCloudCOSXML/Classes/Transfer/request/QCloudCOSXMLUploadObjectRequest.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,6 @@ - (void)uploadOffsetBodys:(NSArray<QCloudFileOffsetBody *> *)allParts {
486486
if (!weakSelf) {
487487
return;
488488
}
489-
490489
__strong typeof(weakSelf) strongSelf = weakSelf;
491490
__strong typeof(weakRequest) strongRequst = weakRequest;
492491
[strongSelf.requstMetricArray addObject:@ { [NSString stringWithFormat:@"%@", strongRequst] : strongRequst.benchMarkMan.tastMetrics }];
@@ -498,6 +497,10 @@ - (void)uploadOffsetBodys:(NSArray<QCloudFileOffsetBody *> *)allParts {
498497
if (!self.canceled) {
499498
[strongSelf cancel];
500499
}
500+
}else if(error && error.code == QCloudNetworkErrorCodeCanceled){
501+
if (!self.canceled) {
502+
[strongSelf cancel];
503+
}
501504
} else {
502505
if (self.enableMD5Verification || self.enableVerification) {
503506
if (outputObject.eTag.length == (kQCloudCOSXMLMD5Length + 2)) {

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.0.9"
13+
s.version = "6.1.0"
1414

1515

1616

QCloudCore/Classes/Base/QCLOUDRestNet/Operations/QCloudOperationQueue.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@
1616
- (void)cancel:(QCloudRequestOperation *)operation;
1717
- (void)cancelByRequestID:(int64_t)requestID;
1818
- (void)cancelByRequestIDs:(NSArray<NSNumber *> *)requestIDs;
19+
- (void)cancelAllOperation;
1920
@end

QCloudCore/Classes/Base/QCLOUDRestNet/Operations/QCloudOperationQueue.m

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,21 @@ - (void)removeRequestInQueue:(int64_t)requestID {
164164
}
165165
}
166166

167+
-(void)cancelAllOperation{
168+
@autoreleasepool {
169+
void (^CancelOperation)(NSMutableArray *array) = ^(NSMutableArray *array) {
170+
for (QCloudRequestOperation *request in [array copy]) {
171+
[request.request cancel];
172+
}
173+
};
174+
CancelOperation(_runningOperationArray);
175+
CancelOperation(_highPerfomanceRequest);
176+
CancelOperation(_lowPerformanceRequest);
177+
CancelOperation(_normalPerformanceRequest);
178+
CancelOperation(_backgroundPerformanceRequest);
179+
}
180+
}
181+
167182
- (void)cancelByRequestIDs:(NSArray<NSNumber *> *)requestIDs {
168183
[_dataLock lock];
169184
for (NSNumber *requestID in requestIDs) {

0 commit comments

Comments
 (0)