Skip to content

Conversation

@j2rong4cn
Copy link
Member

No description provided.

@github-actions
Copy link

github-actions bot commented Jul 7, 2025

⚠️ PR 标题需以 feat(): , docs(): , fix(): , style(): , refactor(): , chore(): 其中之一开头,例如:feat(component): 新增功能
⚠️ The PR title must start with feat(): , docs(): , fix(): , style(): , or refactor(): , chore(): . For example: feat(component): add new feature.

如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。
If it spans multiple components, use the main component as the prefix and enumerate in the title, describe in the body.

@j2rong4cn j2rong4cn changed the title perf: crypt,mega,halalcloud,quark,uc: optimize concurrent response link perf: optimize concurrent response link Jul 8, 2025
@j2rong4cn j2rong4cn marked this pull request as draft July 8, 2025 05:17
@j2rong4cn j2rong4cn marked this pull request as ready for review July 10, 2025 03:56
@SenkjM SenkjM requested a review from Copilot July 10, 2025 04:44
Copy link
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 performance optimization pull request optimizes concurrent response link handling by implementing proper resource management for link objects and refactoring range reading interfaces. The changes improve memory efficiency and prevent resource leaks through systematic use of defer statements for closing links.

Key changes include:

  • Implementing consistent resource cleanup with defer link.Close() across multiple handlers
  • Refactoring RangeReadCloser interface to use RangeReader for better abstraction
  • Adding reference counting for shared link resources to support concurrent access safely

Reviewed Changes

Copilot reviewed 78 out of 78 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
server/webdav/webdav.go Added defer link.Close() calls for proper resource cleanup
server/handles/*.go Standardized link resource management with defer statements
server/s3/backend.go Refactored to use new RangeReader interface with proper cleanup
pkg/utils/io.go Enhanced Closers implementation with sync support and reference counting
internal/stream/util.go Replaced RangeReadCloser with RangeReader interface
internal/model/args.go Updated Link struct to use RangeReader and added Close method
drivers/* Updated driver configurations to use new field names
Comments suppressed due to low confidence (1)

server/s3/backend.go:145

  • [nitpick] The parameter name 's3Obj' is inconsistent with the original 'obj' name and could be confusing. Consider using a more descriptive name like 'object' or keeping the original 'obj' name.
func (b *s3Backend) GetObject(ctx context.Context, bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (s3Obj *gofakes3.Object, err error) {

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>
@xrgzs xrgzs changed the title perf: optimize concurrent response link perf(link): optimize concurrent response Jul 10, 2025
@j2rong4cn j2rong4cn merged commit cc01b41 into main Jul 12, 2025
8 checks passed
@j2rong4cn j2rong4cn deleted the perf-link branch July 19, 2025 17:24
abel533 pushed a commit to liuzh-fork/OpenList that referenced this pull request Jul 21, 2025
* fix(crypt): bug caused by link cache

* perf(crypt,mega,halalcloud,quark,uc): optimize concurrent response link

* chore: 删除无用代码

* ftp

* 修复bug;资源释放

* 添加SyncClosers

* local,sftp,smb

* 重构,优化,增强

* Update internal/stream/util.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>

* chore

* chore

* 优化,修复bug

* .

---------

Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants