Skip to content

Commit 4b39901

Browse files
authored
Merge pull request #410 from YangSen-qn/develop
uc query add host
2 parents eb269d9 + c7ede60 commit 4b39901

File tree

7 files changed

+36
-6
lines changed

7 files changed

+36
-6
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#Changelog
2+
## 8.4.2(2022-02-28)
3+
- uc query 流程增加新的域名
24

35
## 8.4.1(2022-01-27)
46
- 支持 Swift Package Manager

Qiniu.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = 'Qiniu'
3-
s.version = '8.4.1'
3+
s.version = '8.4.2'
44
s.summary = 'Qiniu Resource Storage SDK for iOS and Mac'
55
s.homepage = 'https://github.com/qiniu/objc-sdk'
66
s.social_media_url = 'http://weibo.com/qiniutek'

QiniuSDK/Common/QNAutoZone.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ - (QNRequestTransaction *)createUploadRequestTransaction:(QNUpToken *)token{
210210
if (self.ucHosts && self.ucHosts.count > 0) {
211211
hosts = [self.ucHosts copy];
212212
} else {
213-
hosts = @[kQNPreQueryHost00, kQNPreQueryHost01];
213+
hosts = @[kQNPreQueryHost02, kQNPreQueryHost00, kQNPreQueryHost01];
214214
}
215215
QNRequestTransaction *transaction = [[QNRequestTransaction alloc] initWithHosts:hosts
216216
regionId:QNZoneInfoEmptyRegionId

QiniuSDK/Common/QNConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
//MARK: -- 内部布置 尽量不要修改
1212
#define kQNPreQueryHost00 @"uc.qbox.me"
1313
#define kQNPreQueryHost01 @"api.qiniu.com"
14+
#define kQNPreQueryHost02 @"kodo-config.qiniuapi.com"
1415
#define kQNUpLogHost @"uplog.qbox.me"

QiniuSDK/Utils/QNVersion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
/**
1212
* sdk 版本
1313
*/
14-
static NSString *const kQiniuVersion = @"8.4.1";
14+
static NSString *const kQiniuVersion = @"8.4.2";

QiniuSDKTests/QNAutoZoneTest.m

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#import "QNZoneInfo.h"
2121
#import "QNTestConfig.h"
2222
#import "QNUpToken.h"
23+
#import "QNConfig.h"
2324

2425
@interface QNAutoZoneTest : XCTestCase
2526
@property QNAutoZone* autozone;
@@ -37,6 +38,32 @@ - (void)tearDown {
3738
[super tearDown];
3839
}
3940

41+
- (void)testAutoZone {
42+
QNAutoZone* autoZone = [[QNAutoZone alloc] init];
43+
QNUpToken* tok = [QNUpToken parse:token_na0];
44+
__block int x = 0;
45+
__block int c = 0;
46+
[autoZone preQuery:tok on:^(int code, QNResponseInfo *info, QNUploadRegionRequestMetrics *metrics) {
47+
x = 1;
48+
c = code;
49+
}];
50+
AGWW_WAIT_WHILE(x == 0, 100.0);
51+
XCTAssertEqual(0, c, @"c: %d", c);
52+
}
53+
54+
- (void)testSetUcHosts02 {
55+
QNAutoZone* autoZone = [QNAutoZone zoneWithUcHosts:@[kQNPreQueryHost02]];
56+
QNUpToken* tok = [QNUpToken parse:token_na0];
57+
__block int x = 0;
58+
__block int c = 0;
59+
[autoZone preQuery:tok on:^(int code, QNResponseInfo *info, QNUploadRegionRequestMetrics *metrics) {
60+
x = 1;
61+
c = code;
62+
}];
63+
AGWW_WAIT_WHILE(x == 0, 100.0);
64+
XCTAssertEqual(0, c, @"c: %d", c);
65+
}
66+
4067
- (void)testClearAutoZoneCache {
4168
QNAutoZone *autoZone = [[QNAutoZone alloc] init];
4269
QNUpToken* tok = [QNUpToken parse:token_na0];

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@
1414
通过 CocoaPods
1515

1616
```ruby
17-
pod "Qiniu", "~> 8.4.1"
17+
pod "Qiniu", "~> 8.4.2"
1818
```
1919

2020
通过 Swift Package Manager (Xcode 11+)
2121
```
2222
App 对接:
23-
File -> Swift Packages -> Add Package Dependency,输入 HappyDNS 库链接,选择相应版本即可
23+
File -> Swift Packages -> Add Package Dependency,输入库链接,选择相应版本即可
2424
库链接: https://github.com/qiniu/objc-sdk
2525
2626
库对接:
2727
let package = Package(
2828
dependencies: [
29-
.package(url: "https://github.com/qiniu/objc-sdk", from: "8.4.1")
29+
.package(url: "https://github.com/qiniu/objc-sdk", from: "8.4.2")
3030
],
3131
// ...
3232
)

0 commit comments

Comments
 (0)