Skip to content

Commit

Permalink
Merge pull request #94 from lintianzhi/feature/progress_0.95
Browse files Browse the repository at this point in the history
upload data done, 0.95
  • Loading branch information
longbai committed Sep 4, 2014
2 parents e450c20 + d3dc61e commit 8a90b8f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions QiniuSDK/QiniuResumableClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -287,6 +290,10 @@ - (float) chunkUploadedAndPercent
percent = (float)self.uploadedChunkNumber / self.chunkCount;
[chunkNumlock unlock];

if (percent > 0.95) {
percent = 0.95;
}

return percent;
}

Expand Down
4 changes: 2 additions & 2 deletions QiniuSDK/QiniuResumableUploader.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ - (void) uploadFile:(NSString *)filePath
fileSize:fileSize
extra:extra
uphost:kQiniuUpHosts[mkfileRetryIndex]
progress:nil
progress:weakProgressBlock
complete:weakCompleteBlock];

return;
Expand All @@ -197,7 +197,7 @@ - (void) uploadFile:(NSString *)filePath
fileSize:fileSize
extra:extra
uphost:kQiniuUpHosts[0]
progress:nil
progress:weakProgressBlock
complete:weakCompleteBlock];
return;
}
Expand Down

0 comments on commit 8a90b8f

Please sign in to comment.