[bug fix] 本地文件被多次解密导致报错 The input data is not a complete block #344
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.
当前逻辑会优先使用
本地已经下载好的文件
(参见代码1和代码2)。它存在一个问题,就是会把这个本地文件再走一遍解密流程。但是这个文件可能已经解密过了,再次解密就会报错The input data is not a complete block.
。我修复了一下,把
改名操作
作为整个处理流程(下载和解密)的最后一步,改名完成即认为该文件已经是最终文件了。当再次下载时,如果本地已经存在分片文件,就直接返回,不再走处理逻辑(下载和解密)。