diff --git a/lualib/http/httpc.lua b/lualib/http/httpc.lua index 78cab15e..bc18dad0 100644 --- a/lualib/http/httpc.lua +++ b/lualib/http/httpc.lua @@ -83,9 +83,6 @@ local function connect(host, timeout) end -- print("protocol hostname port", protocol, hostname, port) local interface = gen_interface(protocol, fd, hostname) - if interface.init then - interface.init() - end if timeout then skynet.timeout(timeout, function() if not interface.finish then @@ -93,6 +90,9 @@ local function connect(host, timeout) end end) end + if interface.init then + interface.init() + end return fd, interface, host end