diff options
author | daurnimator <quae@daurnimator.com> | 2013-12-18 17:54:31 -0500 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2013-12-18 17:54:31 -0500 |
commit | 98bd53004dab9e535058cc46cf019610df7ced0f (patch) | |
tree | 50d0ab07ea4d1d8e2b31e8964c827a71ef6290a5 /net/server_select.lua | |
parent | 0639f3d4a3fbd107d93ca064a3248c7f18862aad (diff) | |
download | prosody-98bd53004dab9e535058cc46cf019610df7ced0f.tar.gz prosody-98bd53004dab9e535058cc46cf019610df7ced0f.zip |
net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
Diffstat (limited to 'net/server_select.lua')
-rw-r--r-- | net/server_select.lua | 6 |
1 files changed, 3 insertions, 3 deletions
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 |