File tree Expand file tree Collapse file tree 10 files changed +27
-14
lines changed
Expand file tree Collapse file tree 10 files changed +27
-14
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ sudo: true
55before_install :
66 - rvm install 2.6.4
77 - rvm use 2.6.4
8- - brew update
8+ # - brew update
99 - gem install cocoapods --pre
1010 - pod --version
1111 - rm -rf ~/.cocoapods
Original file line number Diff line number Diff line change 11#Changelog
2+ ## 8.0.3(2020-09-23)
3+ ## 修正
4+ - 修复内存峰值问题
5+ - 优化日志上传统计
6+
27## 8.0.2(2020-09-14)
38## 修正
49- 修复日志上传失败问题
Original file line number Diff line number Diff line change 11Pod ::Spec . new do |s |
22 s . name = 'Qiniu'
3- s . version = '8.0.2 '
3+ s . version = '8.0.3 '
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'
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ - (NSString *)requestReportErrorType{
114114 errorType = @" ssl_error" ;
115115 } else if (self.statusCode == -1015 || self.statusCode == -1016 || self.statusCode == -1017 ){
116116 errorType = @" parse_error" ;
117- } else if (self.statusCode == -1007 || self.statusCode == -1010 || kQNMaliciousResponseError ){
117+ } else if (self.statusCode == -1007 || self.statusCode == -1010 || self. statusCode == kQNMaliciousResponseError ){
118118 errorType = @" malicious_response" ;
119119 } else if (self.statusCode == kQNRequestCancelled
120120 || self.statusCode == NSURLErrorCancelled){
Original file line number Diff line number Diff line change @@ -164,6 +164,9 @@ - (instancetype)initWithResponseInfoHost:(NSString *)host
164164 _statusCode = (int )error.code ;
165165 _message = [NSString stringWithFormat: @" %@ " , error];
166166 _responseDictionary = nil ;
167+ } else {
168+ _statusCode = -9 ;
169+ _message = @" no response" ;
167170 }
168171 }
169172 return self;
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
1313
1414@interface QNUploadSingleRequestMetrics : NSObject
1515
16- @property (copy ) NSURLRequest *request;
17- @property (nullable , copy ) NSURLResponse *response;
16+ @property (nonatomic , copy ) NSURLRequest *request;
17+ @property (nullable , copy ) NSURLResponse *response;
1818
1919@property (nullable , copy ) NSDate *startDate;
2020@property (nullable , copy ) NSDate *endDate;
Original file line number Diff line number Diff line change @@ -33,6 +33,18 @@ - (void)initData{
3333 _countOfResponseBodyBytesReceived = 0 ;
3434}
3535
36+ - (void )setRequest : (NSURLRequest *)request {
37+ NSMutableURLRequest *newRequest = [NSMutableURLRequest requestWithURL: request.URL
38+ cachePolicy: request.cachePolicy
39+ timeoutInterval: request.timeoutInterval];
40+ newRequest.allHTTPHeaderFields = request.allHTTPHeaderFields ;
41+
42+ NSInteger headerLength = [NSString stringWithFormat: @" %@ " , self .request.allHTTPHeaderFields].length ;
43+ NSInteger bodyLength = [self .request.qn_getHttpBody length ];
44+ _totalBytes = @(headerLength + bodyLength);
45+ _request = [newRequest copy ];
46+ }
47+
3648- (NSNumber *)totalElapsedTime {
3749 return [self timeFromStartDate: self .startDate
3850 toEndDate: self .endDate];
@@ -68,12 +80,6 @@ - (NSNumber *)totalResponseTime{
6880 toEndDate: self .responseEndDate];
6981}
7082
71- - (NSNumber *)totalBytes {
72- NSInteger headerLength = [NSString stringWithFormat: @" %@ " , self .request.allHTTPHeaderFields].length ;
73- NSInteger bodyLength = [self .request.qn_getHttpBody length ];
74- return @(headerLength + bodyLength);
75- }
76-
7783- (NSNumber *)bytesSend {
7884 int64_t totalBytes = [self totalBytes ].integerValue ;
7985 int64_t senderBytes = self.countOfRequestBodyBytesSent + self.countOfRequestHeaderBytesSent ;
Original file line number Diff line number Diff line change @@ -62,7 +62,6 @@ - (void)URLSession:(NSURLSession *)session dataTask:(NSURLSessionDataTask *)data
6262}
6363
6464- (void )URLSession : (NSURLSession *)session task : (NSURLSessionTask *)task didCompleteWithError : (nullable NSError *)error {
65-
6665 self.requestMetrics .endDate = [NSDate date ];
6766 self.requestMetrics .request = task.currentRequest ;
6867 self.requestMetrics .response = task.response ;
Original file line number Diff line number Diff line change 1111/* *
1212 * sdk 版本
1313 */
14- static NSString *const kQiniuVersion = @" 8.0.2 " ;
14+ static NSString *const kQiniuVersion = @" 8.0.3 " ;
Original file line number Diff line number Diff line change 1313通过 CocoaPods
1414
1515``` ruby
16- pod " Qiniu" , " ~> 8.0.2 "
16+ pod " Qiniu" , " ~> 8.0.3 "
1717```
1818
1919## 运行环境
You can’t perform that action at this time.
0 commit comments