From 98bd53004dab9e535058cc46cf019610df7ced0f Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 18 Dec 2013 17:54:31 -0500 Subject: net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure --- net/server_select.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'net') diff --git a/net/server_select.lua b/net/server_select.lua index e319e016..bd4e59df 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -936,11 +936,11 @@ local addclient = function( address, port, listeners, pattern, sslctx ) return nil, err end client:settimeout( 0 ) - _, err = client:connect( address, port ) - if err then -- try again + local ok, err = client:connect( address, port ) + if ok or err == "timeout" then return wrapclient( client, address, port, listeners, pattern, sslctx ) else - return wrapconnection( nil, listeners, client, address, port, "clientport", pattern, sslctx ) + return nil, err end end -- cgit v1.2.3