fix(http): reset discarded prefetch progress on resume (#1462)

This commit is contained in:
Levi authored and GitHub committed 2026-08-31 23:05:01 +08:00
1 parent 962ff4dc98
commit c5c8bb2bf5
6 files changed
+93 -9

No files matched your search

+4
View File
@@ -584,6 +584,10 @@ func (f *Fetcher) cleanupPrefetchFile() {
os.Remove(f.prefetchFilePath)
f.prefetchFilePath = ""
}
// The byte count is only reusable while the backing prefetch file exists.
// Pause may discard that file before the first Start, so retaining the
// count would make the next Start skip bytes that were never copied.
f.prefetchSize.Store(0)
}
func (f *Fetcher) Start() error {