aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2013-12-18 17:54:31 -0500
committerdaurnimator <quae@daurnimator.com>2013-12-18 17:54:31 -0500
commite5e8cfdccfa3bd1f55e38f19052613fe0fef2ca0 (patch)
treed37f09692d9745b9070453f3eb227c4d349eb36e /net
parentc8183e66556b4d705eb34158f163a7e6a62e9207 (diff)
downloadprosody-e5e8cfdccfa3bd1f55e38f19052613fe0fef2ca0.tar.gz
prosody-e5e8cfdccfa3bd1f55e38f19052613fe0fef2ca0.zip
net/server_select: addclient: Check for failure correctly; remove wrapconnection call on failure
Diffstat (limited to 'net')
-rw-r--r--net/server_select.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/server_select.lua b/net/server_select.lua
index 62c889e9..14d55a32 100644
--- a/net/server_select.lua
+++ b/net/server_select.lua
@@ -948,11 +948,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