From e3316d22e221658d729afa3dd068fbe76f420053 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Mon, 4 Dec 2017 13:30:58 +0000 Subject: properly shutdown http stream --- generate-json.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3