From 37157273ff9e045fbcd42b8fc604291558abd45a Mon Sep 17 00:00:00 2001 From: chengzhe Date: Tue, 17 Oct 2017 17:50:54 +0800 Subject: [PATCH] =?UTF-8?q?http=E4=B8=ADconnect=E5=8F=AF=E8=83=BD=E4=BC=9A?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=A4=B1=E8=B4=A5,=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E5=BD=93=E5=B0=86=E9=94=99=E8=AF=AF=E7=9A=84fd=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E4=BC=A0=E9=80=92=E4=B8=8B=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lualib/http/httpc.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lualib/http/httpc.lua b/lualib/http/httpc.lua index 33f3eee4..975ccaa9 100644 --- a/lualib/http/httpc.lua +++ b/lualib/http/httpc.lua @@ -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()