Skip to content

Commit 12f73e5

Browse files
authored
DOWNLOAD: fixes the extraction of download file size and status calculation (#379)
1 parent 04195af commit 12f73e5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/download/download.scm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
111111
(let* ((size-start (string-contains (car str) "Content-Length: "))
112112
(size-rest (substring (car str) size-start (string-length (car str))))
113113
(size-stop (string-contains size-rest "\n"))
114-
(size-only (string->number (substring size-rest 18 (- size-stop 1)))))
114+
(size-only (string->number (substring size-rest 16 (- size-stop 1)))))
115115
(log-status "download:append: content length " size-only)
116116
(set! download:size size-only)
117117
(set! download:header 200)
@@ -241,7 +241,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
241241
(let ((tmpsize (if (file-exists? download:tempfile) (file-size download:tempfile) 0.)))
242242
(if (file-exists? filepath)
243243
1.
244-
(if (> download:size 0) (/ tmpsize download:size) 0.))
244+
(if (> download:size 0) (/ (flo tmpsize) download:size) 0.))
245245
))
246246

247247
;; eof

0 commit comments

Comments
 (0)