Skip to content

Conversation

@hshpy
Copy link
Contributor

@hshpy hshpy commented May 27, 2025

修复夸克驱动新建文件无法预览。

@petercat-assistant
Copy link

Walkthrough

此更改修复了在下载文件时出现的0KB错误。通过在internal/net/request.go中添加逻辑,当d.params.Range.Length为0时,将并发数设置为1,从而避免了文件无法正确下载的问题。

Changes

文件 摘要
internal/net/request.go 添加了检查d.params.Range.Length是否为0的逻辑,并在这种情况下将并发数设置为1。

if maxPart < d.cfg.Concurrency {
d.cfg.Concurrency = maxPart
}
if d.params.Range.Length == 0 {

Choose a reason for hiding this comment

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

The added condition checks if d.params.Range.Length is 0, which sets the concurrency to 1. This change is crucial to prevent downloading errors when the file size is 0KB, ensuring that the download process does not attempt to use multiple connections unnecessarily.

@hshpy hshpy closed this Jun 13, 2025
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.

1 participant