From 0ca812e3dde8a817b1200dcbb3062f8cf34a752b Mon Sep 17 00:00:00 2001 From: Vladimir Bauer Date: Mon, 10 Jan 2022 23:00:47 +0500 Subject: [PATCH] set p.Stop for non resumable session This makes sure that p.isDone returns true eventually. --- part.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/part.go b/part.go index 5bb4b12..6c4aa7d 100644 --- a/part.go +++ b/part.go @@ -272,6 +272,9 @@ func (p *Part) download( p.dlogger.Printf("Written: %d", p.Written-pWrittenSnap) if err == io.EOF { + if p.total() <= 0 { + p.Stop = p.Written - 1 + } return false, nil }