# HG changeset patch # User daurnimator # Date 1387407271 18000 # Node ID 9e3b15199ec53a0575bc32016ed2270976cd5f9c # Parent 451b4649fad227a0013c60147032a6d0c09d84f1 net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure diff -r 451b4649fad2 -r 9e3b15199ec5 net/server_select.lua --- a/net/server_select.lua Wed Dec 18 17:52:28 2013 -0500 +++ b/net/server_select.lua Wed Dec 18 17:54:31 2013 -0500 @@ -936,11 +936,11 @@ 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