Skip to content

Commit 57c1c59

Browse files
committed
fix download issue
Signed-off-by: abzcoding <[email protected]>
1 parent a44a1fb commit 57c1c59

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func (d *HTTPDownloader) Do(doneChan chan bool, fileChan chan string, errorChan
333333

334334
// handleCompletedPart simply notifies that a part doesn't need downloading.
335335
func (d *HTTPDownloader) handleCompletedPart(p Part, fileChan chan string, stateSaveChan chan Part) {
336-
fileChan <- p.Path
336+
// Avoid sending path here; we'll assemble paths from final states in main
337337
// Send a part indicating no additional data
338338
stateSaveChan <- Part{
339339
Index: p.Index,

main.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ func Execute(url string, state *State, conn int, skiptls bool, proxy string, bwL
154154
part := <-stateChan
155155
parts = append(parts, part)
156156
}
157+
// Build file list from final part states to avoid missing/duplicate paths
158+
files = make([]string, 0, len(parts))
159+
for _, p := range parts {
160+
files = append(files, p.Path)
161+
}
157162
if isInterrupted {
158163
if downloader.resumable {
159164
Printf("Interrupted, saving state...\n")

0 commit comments

Comments
 (0)