Skip to content

Commit 2b45b16

Browse files
committed
fix(download): initialize progress counter on resume
When resuming a download, Task.Cur started from 0 instead of the number of already-downloaded chunks, causing misleading progress display (e.g., "1/575" instead of "56/575"). Set Cur to current_cur-1 before the first Done() call so the counter reflects actual progress.
1 parent acc84b7 commit 2b45b16

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

server/rpc/rpc-file.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ func (rpc *Server) Download(ctx context.Context, req *implantpb.DownloadRequest)
334334
os.Rename(tempDir, backupDir)
335335
os.MkdirAll(tempDir, 0755)
336336
} else {
337+
greq.Task.Cur = int(current_cur) - 1
337338
greq.Task.Done(resp, "resuming download")
338339
var complete bool
339340
current_cur, complete, err = scanDownloadChunks(tempDir, total)

0 commit comments

Comments
 (0)