fix(terabox): big file upload issue #7498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
修复问题
#7490
问题原因
/api/create
接口报错,返回了errno
和errmsg
,但alist
没有对errno
做判断,导致页面上误显示为上传成功;errno: 10
和errmsg: "create super file failed."
,无法定位到问题,所以需查看官方接口参数;Terabox
抓包分析,在上传超过8GB
的文件时,chunk
大小为16MB
,而alist
的逻辑用的是4MB
,可能因为chunk
太多导致在最终的/api/create
接口中上传失败;Terabox
还更新了/api/precreate
接口的入参字段。修复方案
Terabox
做了多次抓包分析,发现chunk
的大小会按如下规则动态调整:/api/precreate
接口中,请求体有如下变化:其中
block_list
是固定值,用多个账号测试发现都是这个值,不再需要在这个阶段计算chunks
的md5
了。3. 额外修正了
local_mtime
字段的值,改成本地文件的mtime
,不应该传当前时间戳。自测结果