aboutsummaryrefslogtreecommitdiffstats
path: root/generate-json.lua
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2017-12-04 13:30:58 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2017-12-04 13:30:58 +0000
commite3316d22e221658d729afa3dd068fbe76f420053 (patch)
tree969308739077ddc866647a54f7c7f11f9ffa931d /generate-json.lua
parentfbaee8aa6f163fb6427427f77bd81ab16a1a1575 (diff)
downloadalpine-mirror-status-e3316d22e221658d729afa3dd068fbe76f420053.tar.bz2
alpine-mirror-status-e3316d22e221658d729afa3dd068fbe76f420053.tar.xz
properly shutdown http stream
Diffstat (limited to 'generate-json.lua')
-rwxr-xr-xgenerate-json.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/generate-json.lua b/generate-json.lua
index c62ee32..1e16735 100755
--- a/generate-json.lua
+++ b/generate-json.lua
@@ -42,6 +42,7 @@ function get_mirrors(uri)
error("Failed to get mirrors yaml!")
end
local y = assert(stream:get_body_as_string())
+ stream:shutdown()
local mirrors = yaml.load(y)
for idx, mirror in ipairs(mirrors) do
for _,url in ipairs(mirror.urls) do
@@ -56,7 +57,8 @@ end
function get_index_status(uri)
local res = {}
local status, modified
- local headers = request.new_from_uri(uri):go(conf.http_timeout)
+ local headers, stream = request.new_from_uri(uri):go(conf.http_timeout)
+ stream:shutdown()
if headers then
status = headers:get(":status")
else