From 55a097981ec6c98f4dd3115e143c066fbe90d8e3 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 25 Jun 2014 12:15:00 -0400 Subject: net/server_*: Fix addclient: LuaSocket 3.0-rc1 sometimes returns EALREADY instead of EINPROGRESS when the dns lookup has multiple results --- net/server_event.lua | 2 +- net/server_select.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/net/server_event.lua b/net/server_event.lua index a3087847..b79fc463 100644 --- a/net/server_event.lua +++ b/net/server_event.lua @@ -761,7 +761,7 @@ do end client:settimeout( 0 ) -- set nonblocking local res, err = client:connect( addr, serverport ) -- connect - if res or ( err == "timeout" ) then + if res or ( err == "timeout" or err == "Operation already in progress" ) then if client.getsockname then addr = client:getsockname( ) end diff --git a/net/server_select.lua b/net/server_select.lua index 4a36617c..0aaea4be 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -966,7 +966,7 @@ local addclient = function( address, port, listeners, pattern, sslctx, typ ) end client:settimeout( 0 ) local ok, err = client:connect( address, port ) - if ok or err == "timeout" then + if ok or err == "timeout" or err == "Operation already in progress" then return wrapclient( client, address, port, listeners, pattern, sslctx ) else return nil, err -- cgit v1.2.3