mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
http中connect可能会连接失败,不应当将错误的fd继续传递下去
This commit is contained in:
@@ -100,6 +100,10 @@ function httpc.request(method, host, url, recvheader, header, content)
|
||||
hostname = dns.resolve(hostname)
|
||||
end
|
||||
local fd = socket.connect(hostname, port, timeout)
|
||||
if not fd then
|
||||
error(string.format("http connect error host:%s, port:%s, timeout:%s", hostname, port, timeout))
|
||||
return
|
||||
end
|
||||
local finish
|
||||
if timeout then
|
||||
skynet.timeout(timeout, function()
|
||||
|
||||
Reference in New Issue
Block a user