diff --git a/QiniuSDK/QiniuResumableClient.m b/QiniuSDK/QiniuResumableClient.m index 80759c8..cdcac39 100644 --- a/QiniuSDK/QiniuResumableClient.m +++ b/QiniuSDK/QiniuResumableClient.m @@ -207,6 +207,9 @@ - (void)mkfile:(NSString *)key QNCompleteBlock success = ^(AFHTTPRequestOperation *operation, id responseObject) { + if (progressBlock != nil) { + progressBlock(1); + } complete(operation, nil); }; QNCompleteBlock failure = ^(AFHTTPRequestOperation *operation, NSError *error) @@ -287,6 +290,10 @@ - (float) chunkUploadedAndPercent percent = (float)self.uploadedChunkNumber / self.chunkCount; [chunkNumlock unlock]; + if (percent > 0.95) { + percent = 0.95; + } + return percent; } diff --git a/QiniuSDK/QiniuResumableUploader.m b/QiniuSDK/QiniuResumableUploader.m index cf5e91d..7d6dce4 100644 --- a/QiniuSDK/QiniuResumableUploader.m +++ b/QiniuSDK/QiniuResumableUploader.m @@ -180,7 +180,7 @@ - (void) uploadFile:(NSString *)filePath fileSize:fileSize extra:extra uphost:kQiniuUpHosts[mkfileRetryIndex] - progress:nil + progress:weakProgressBlock complete:weakCompleteBlock]; return; @@ -197,7 +197,7 @@ - (void) uploadFile:(NSString *)filePath fileSize:fileSize extra:extra uphost:kQiniuUpHosts[0] - progress:nil + progress:weakProgressBlock complete:weakCompleteBlock]; return; }