Close HTTP connections
This commit is contained in:
parent
ab667b6779
commit
e978bf7b33
2 changed files with 3 additions and 1 deletions
|
@ -100,6 +100,7 @@ function get_http_request(link)
|
||||||
['User-Agent'] = runtime.userAgent
|
['User-Agent'] = runtime.userAgent
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
httpc:close()
|
||||||
return res, err
|
return res, err
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,7 @@ function M.Validate(g_captcha_res, remote_ip)
|
||||||
|
|
||||||
local data = table_to_encoded_url(body)
|
local data = table_to_encoded_url(body)
|
||||||
local httpc = http.new()
|
local httpc = http.new()
|
||||||
httpc:set_timeout(1000)
|
httpc:set_timeout(2000)
|
||||||
local res, err = httpc:request_uri(recaptcha_verify_url, {
|
local res, err = httpc:request_uri(recaptcha_verify_url, {
|
||||||
method = "POST",
|
method = "POST",
|
||||||
body = data,
|
body = data,
|
||||||
|
@ -94,6 +94,7 @@ function M.Validate(g_captcha_res, remote_ip)
|
||||||
["Content-Type"] = "application/x-www-form-urlencoded",
|
["Content-Type"] = "application/x-www-form-urlencoded",
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
httpc:close()
|
||||||
if err ~= nil then
|
if err ~= nil then
|
||||||
return true, err
|
return true, err
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue