From db2ffa79f10ebcb6cd702bfceb3533a97e892409 Mon Sep 17 00:00:00 2001 From: Tim Scheuermann Date: Fri, 24 May 2024 20:30:42 +0200 Subject: [PATCH] Fix download retry issue --- server/download.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/download.go b/server/download.go index db4d1f4e..5a735abf 100644 --- a/server/download.go +++ b/server/download.go @@ -221,7 +221,7 @@ func (b *blobDownload) downloadChunk(ctx context.Context, requestURL *url.URL, w } defer resp.Body.Close() - n, err := io.CopyN(w, io.TeeReader(resp.Body, part), part.Size) + n, err := io.CopyN(w, io.TeeReader(resp.Body, part), part.Size-part.Completed) if err != nil && !errors.Is(err, context.Canceled) && !errors.Is(err, io.ErrUnexpectedEOF) { // rollback progress b.Completed.Add(-n)