mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
close socket after request
This commit is contained in:
@@ -81,10 +81,10 @@ function httpc.request(method, host, url, recvheader, header, content)
|
||||
end
|
||||
local fd = socket.connect(hostname, port)
|
||||
local ok , statuscode, body = pcall(request, fd,method, host, url, recvheader, header, content)
|
||||
socket.close(fd)
|
||||
if ok then
|
||||
return statuscode, body
|
||||
else
|
||||
socket.close(fd)
|
||||
error(statuscode)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user