Software /
code /
prosody
Comparison
net/server_event.lua @ 6286:ec6e8d5a3fd3
net/server_*: Fix addclient: LuaSocket 3.0-rc1 sometimes returns EALREADY instead of EINPROGRESS when the dns lookup has multiple results
author | daurnimator <quae@daurnimator.com> |
---|---|
date | Wed, 25 Jun 2014 12:15:00 -0400 |
parent | 6055:596539a30e9b |
child | 6316:e144a1b67c30 |
comparison
equal
deleted
inserted
replaced
6285:ea60d0441df7 | 6286:ec6e8d5a3fd3 |
---|---|
759 debug( "cannot create socket:", err ) | 759 debug( "cannot create socket:", err ) |
760 return nil, err | 760 return nil, err |
761 end | 761 end |
762 client:settimeout( 0 ) -- set nonblocking | 762 client:settimeout( 0 ) -- set nonblocking |
763 local res, err = client:connect( addr, serverport ) -- connect | 763 local res, err = client:connect( addr, serverport ) -- connect |
764 if res or ( err == "timeout" ) then | 764 if res or ( err == "timeout" or err == "Operation already in progress" ) then |
765 if client.getsockname then | 765 if client.getsockname then |
766 addr = client:getsockname( ) | 766 addr = client:getsockname( ) |
767 end | 767 end |
768 local interface = wrapclient( client, addr, serverport, listener, pattern, sslctx ) | 768 local interface = wrapclient( client, addr, serverport, listener, pattern, sslctx ) |
769 debug( "new connection id:", interface.id ) | 769 debug( "new connection id:", interface.id ) |