From f67864f86c7d703325e86b14d0ba33992c52891b Mon Sep 17 00:00:00 2001 From: Diego Nehab Date: Sat, 24 Jan 2004 03:21:33 +0000 Subject: [PATCH] DNS lookup was taking too long and fucking up the connect tests. --- test/testclnt.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/testclnt.lua b/test/testclnt.lua index 5f366b2..348439a 100644 --- a/test/testclnt.lua +++ b/test/testclnt.lua @@ -365,14 +365,16 @@ end ------------------------------------------------------------------------ function connect_timeout() io.write("connect with timeout (if it hangs, it failed): ") - local t = socket.time() local c, e = socket.tcp() assert(c, e) c:settimeout(0.1) - local r, e = c:connect("ibere.tecgraf.puc-rio.br", 80) + ip = socket.dns.toip("ibere.tecgraf.puc-rio.br") + if not ip then return end + local t = socket.time() + local r, e = c:connect(ip, 80) assert(not r, "should not connect") assert(e == "timeout", e) - assert(socket.time() - t < 2, "took to long to give up") + assert(socket.time() - t < 2, "took too long to give up.") c:close() end