Skip to content

feat(139): add option ReportRealSize#8244

Merged
xhofe merged 3 commits intoAlistGo:mainfrom
xrgzs:fix/139-family-100mb
Apr 3, 2025
Merged

feat(139): add option ReportRealSize#8244
xhofe merged 3 commits intoAlistGo:mainfrom
xrgzs:fix/139-family-100mb

Conversation

@xrgzs
Copy link
Copy Markdown
Contributor

@xrgzs xrgzs commented Mar 27, 2025

Close: #8141

@petercat-assistant
Copy link
Copy Markdown

Walkthrough

This PR addresses issue #8141 by ensuring that the upload size limit is enforced. It modifies the handling of file uploads to correctly calculate and check the total size and content size of uploads, preventing bypassing of the size restrictions.

Changes

File Summary
drivers/139/driver.go Updated to calculate and enforce upload size limits, added error handling for upload failures, and improved response parsing using XML.
drivers/139/types.go Introduced a new struct InterLayerUploadResult for XML response parsing.

Comment thread drivers/139/driver.go Outdated
Comment thread drivers/139/driver.go
@ZZ0YY
Copy link
Copy Markdown

ZZ0YY commented Mar 28, 2025

请问这个更改是做出了什么改良吗?能解决上传伪成功吗?是否如同标题 去除了绕过大小限制的用法从而正常,主要是新的发行版似乎没有发出这个更改

@xrgzs
Copy link
Copy Markdown
Contributor Author

xrgzs commented Mar 28, 2025

去除了绕过大小限制的用法从而正常

对的,顺便加上了报错功能,之前没有报错,加上后发现上传到第二个分片时那边判断为非法请求就不给继续上传了

@ZZ0YY
Copy link
Copy Markdown

ZZ0YY commented Mar 29, 2025

去除了绕过大小限制的用法从而正常

对的,顺便加上了报错功能,之前没有报错,加上后发现上传到第二个分片时那边判断为非法请求就不给继续上传了

下次合并分支前能不能考虑把这个改成一个开关?因为目前这还是有一定可玩性的,实验把分片大小改成超过 50GB,能够完整流式传输 50GB 内的文件😊请注意,仅限家庭云实验了,新个人云由于无法流式上传,没有实验。应该会提示权益不足

@xrgzs xrgzs force-pushed the fix/139-family-100mb branch from 8fb9c04 to fcb1730 Compare March 29, 2025 07:54
@xrgzs
Copy link
Copy Markdown
Contributor Author

xrgzs commented Mar 29, 2025

改成一个开关

已修改

新个人云由于无法流式上传

新个人云使用单独的分片上传方式,不支持这种玩法,最大分片好像不能超过5GB

@xrgzs xrgzs changed the title fix(139): do not bypass the upload size limit feat(139): add option ReportRealSize Mar 29, 2025
@xhofe xhofe requested a review from Copilot March 29, 2025 08:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new ReportRealSize option and related XML upload result handling for driver 139. Key changes include:

  • Adding the InterLayerUploadResult struct in types.go for XML response parsing.
  • Introducing the ReportRealSize configuration field in meta.go.
  • Modifying driver.go to use the new ReportRealSize option when uploading and to parse XML responses for error handling.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
drivers/139/types.go Adds a new struct (InterLayerUploadResult) for XML response parsing.
drivers/139/meta.go Adds the ReportRealSize boolean flag to configuration.
drivers/139/driver.go Uses the ReportRealSize option to set the file size and parses XML responses.
Comments suppressed due to low confidence (1)

drivers/139/types.go:146

  • [nitpick] Consider renaming 'InterLayerUploadResult' to 'InterLayerUploadResponse' for clearer identification that the struct holds XML response data.
type InterLayerUploadResult struct {

Comment thread drivers/139/driver.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@xhofe xhofe merged commit af18cb1 into AlistGo:main Apr 3, 2025
12 checks passed
@xrgzs xrgzs deleted the fix/139-family-100mb branch April 6, 2025 14:49
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