Skip to content

Bugfix/resumbleupload #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 31, 2014
Merged

Conversation

icattlecoder
Copy link
Contributor

http://pm.qbox.me/redmine/issues/7116

简化断点续上传,删除bput逻辑
修复bug:>2.5GB文件上传失败

if ((i + 1) * BLOCKSIZE > fsize)
readLen = (int)(fsize - i * BLOCKSIZE);
if ((long)(i + 1) * BLOCKSIZE > fsize)
readLen = (int)(fsize - (long)i * BLOCKSIZE);
byte[] byteBuf = new byte[readLen];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 byteBuf 不用每次都 new 出来,应该提到 for 循环以外

@@ -96,27 +98,15 @@ public CallRet PutFile(string upToken, string localFile, string key)
fsize = fs.Length;
chunks = fsize / extra.chunkSize + 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

chunks 的计算结果并不正确

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接取消 chunk 概念,用 block_cnt 吧。

@@ -21,14 +22,6 @@ public class ResumablePut
private const int blockMashk = (1 << blockBits) - 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个为何不用blockMashk = BLOCKSIZE-1 清晰明了

@longbai
Copy link
Contributor

longbai commented Mar 31, 2014

LGTM, blockMashk = BLOCKSIZE-1 in next pr

longbai added a commit that referenced this pull request Mar 31, 2014
@longbai longbai merged commit df03bce into qiniu:develop Mar 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants