From 21eae5da72f3a96482ff479841b214a01ede3652 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 16 Jan 2023 21:10:21 -0500 Subject: Fixed some issues with naming, and calling progression function. --- src/lpm.c | 2 +- src/lpm.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lpm.c b/src/lpm.c index b6df2c9..14d2724 100644 --- a/src/lpm.c +++ b/src/lpm.c @@ -877,7 +877,7 @@ static int lpm_get(lua_State* L) { lua_pushvalue(L, callback_function); lua_pushinteger(L, total_downloaded); lua_pushinteger(L, content_length); - lua_call(L, 1, 0); + lua_call(L, 2, 0); } fwrite(buffer, sizeof(char), length, file); remaining -= length; diff --git a/src/lpm.lua b/src/lpm.lua index cfcfc18..b5aeaaa 100644 --- a/src/lpm.lua +++ b/src/lpm.lua @@ -525,7 +525,7 @@ function common.get(source, target, checksum, callback, depth) return res end if not system.stat(CACHEDIR .. PATHSEP .. "files") then common.mkdirp(CACHEDIR .. PATHSEP .. "files") end - local cache_path = CACHEDIR .. PATHSEP .. "files" .. PATHSEP .. checksum + local cache_path = CACHEDIR .. PATHSEP .. "files" .. PATHSEP .. (checksum ~= "SKIP" and checksum or system.hash(source)) if not system.stat(cache_path) then local res, headers = system.get(protocol, hostname, port, rest, cache_path, callback) if headers.location then return common.get(headers.location, target, checksum, callback, (depth or 0) + 1) end -- cgit v1.2.3