Skip to content

Commit 58bb0fa

Browse files
author
garenwang
committed
# 6.0.3
1 parent b0f2cee commit 58bb0fa

24 files changed

+208
-78
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 6.0.3
2+
3+
14
# 6.0.2
25

36

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

77

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

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

3535
end
3636

QCloudCOSXML/Classes/Base/QCloudCOSXMLService+Quality.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#import <QCloudCore/QCloudLogger.h>
1313
#import "QCloudCOSXMLVersion.h"
1414
#import <QCloudCore/QualityDataUploader.h>
15+
#import <QCloudCore/QCloudServiceConfiguration+Quality.h>
1516

1617
@implementation QCloudCOSXMLService (Quality)
1718

@@ -31,8 +32,10 @@ + (void)changeImplementation {
3132

3233
+ (QCloudCOSXMLService *)Quality_registerDefaultCOSXMLWithConfiguration:(QCloudServiceConfiguration *)configuration {
3334
id result = [self Quality_registerDefaultCOSXMLWithConfiguration:configuration];
34-
35-
[self initMTA];
35+
if(!configuration.disableSetupBeacon){
36+
[self initMTA];
37+
}
38+
3639
return result;
3740
}
3841

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 600002
8+
#define QCloudCOSXMLModuleVersionNumber 600003
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.0.2";
2+
NSString * const QCloudCOSXMLModuleVersion = @"6.0.3";
33
NSString * const QCloudCOSXMLModuleName = @"QCloudCOSXML";
44
@interface QCloudQCloudCOSXMLLoad : NSObject
55
@end

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

1515

1616

QCloudCore/Classes/Base/QCLOUDRestNet/SessionSupport/QCloudHTTPSessionManager.m

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,16 +548,17 @@ - (void)executeRestHTTPReqeust:(QCloudHTTPRequest *)httpRequest {
548548
ipAddr = [[QCloudHttpDNS shareDNS] queryIPForHost:host];
549549
}
550550
if (!ipAddr) {
551-
// 查询 可用的 ip 地址
551+
// 查询 可用的 ip 地址tc
552552
[[QCloudHttpDNS shareDNS] prepareFetchIPListForHost:host port:@"443"];
553553
ipAddr = [[QCloudHttpDNS shareDNS] findHealthyIpFor:host];
554554
}
555555
if (!ipAddr) {
556556
@throw [NSException exceptionWithName:NSURLErrorDomain reason:@"No Available IP Address for QUIC." userInfo:nil];
557557
}
558558

559-
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
560-
559+
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:transformRequest.allHTTPHeaderFields];
560+
561+
561562
dic[@"quicHost"] = host;
562563
dic[@"quicIP"] = ipAddr;
563564
if (uploadFileURL) {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//
2+
// QCloudServiceConfiguration+Quality.h
3+
// QCloudCore
4+
//
5+
// Created by karisli(李雪) on 2022/1/18.
6+
//
7+
8+
#import <QCloudCore/QCloudCore.h>
9+
10+
NS_ASSUME_NONNULL_BEGIN
11+
12+
@interface QCloudServiceConfiguration (Quality)
13+
14+
@property (nonatomic, assign) BOOL disableSetupBeacon;
15+
@end
16+
17+
NS_ASSUME_NONNULL_END
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// QCloudServiceConfiguration+Quality.m
3+
// QCloudCore
4+
//
5+
// Created by karisli(李雪) on 2022/1/18.
6+
//
7+
8+
#import "QCloudServiceConfiguration+Quality.h"
9+
#import <objc/runtime.h>
10+
@implementation QCloudServiceConfiguration (Quality)
11+
NSString *const disableSetupBeaconKey = @"disableBeaconKey";
12+
13+
-(void)setDisableSetupBeacon:(BOOL)disableSetupBeacon{
14+
objc_setAssociatedObject(self, &disableSetupBeaconKey, [NSNumber numberWithBool:disableSetupBeacon], OBJC_ASSOCIATION_ASSIGN);
15+
}
16+
-(BOOL)disableSetupBeacon{
17+
//因为在set方法中转成了number类型,所以这里需要转成Bool类型
18+
return [objc_getAssociatedObject(self, &disableSetupBeaconKey) boolValue];
19+
}
20+
@end

QCloudCore/Classes/Base/QCloudClientBase/Request/QCloudBizHTTPRequest.m

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ QCloudResponseSerializerBlock QCloudResponseObjectSerilizerBlock(Class modelClas
6161
return (id)(transformData.data);
6262
};
6363

64+
@interface QCloudBizHTTPRequest ()
65+
@property (nonatomic,strong,nullable)dispatch_semaphore_t semaphore;
66+
@end
67+
68+
6469
@implementation QCloudBizHTTPRequest
6570

6671
- (instancetype)init {
@@ -108,7 +113,7 @@ - (QCloudSignatureFields *)signatureFields {
108113

109114
- (BOOL)prepareInvokeURLRequest:(NSMutableURLRequest *)urlRequest error:(NSError *__autoreleasing *)error {
110115
// NSAssert(self.runOnService, @"RUN ON SERVICE is nil%@", self.runOnService);
111-
__block dispatch_semaphore_t semaphore = dispatch_semaphore_create(0);
116+
self.semaphore = dispatch_semaphore_create(0);
112117
__block NSError *localError;
113118
__block BOOL isSigned;
114119
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
@@ -141,11 +146,12 @@ - (BOOL)prepareInvokeURLRequest:(NSMutableURLRequest *)urlRequest error:(NSError
141146
// null authorization
142147
}
143148
}
144-
dispatch_semaphore_signal(semaphore);
149+
dispatch_semaphore_signal(self.semaphore);
150+
self.semaphore = nil;
145151
}];
146152
});
147153

148-
dispatch_semaphore_wait(semaphore, dispatch_time(DISPATCH_TIME_NOW, 15 * NSEC_PER_SEC));
154+
dispatch_semaphore_wait(self.semaphore, dispatch_time(DISPATCH_TIME_NOW, 15 * NSEC_PER_SEC));
149155
if (localError) {
150156
if (NULL != error) {
151157
*error = localError;
@@ -177,6 +183,14 @@ - (void)loadQCloudSignature {
177183
NSData *md5data = [NSData dataWithBytes:result length:CC_MD5_DIGEST_LENGTH];
178184
return [md5data base64EncodedStringWithOptions:0];
179185
}
186+
187+
- (void)dealloc{
188+
if (self.semaphore) {
189+
dispatch_semaphore_signal(self.semaphore);
190+
self.semaphore = nil;
191+
}
192+
}
193+
180194
- (void)setCOSServerSideEncyption {
181195
self.customHeaders[@"x-cos-server-side-encryption"] = @"AES256";
182196
}

0 commit comments

Comments
 (0)