aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-03-01 23:33:41 +0000
committerMatthew Wild <mwild1@gmail.com>2009-03-01 23:33:41 +0000
commitfffdba514a7f52494dbc6943da525171d2fd7104 (patch)
tree0123f77f0a3ed8959c4506547e743d1b4367146a /net/server.lua
parent1c998c518c525feb7555f6c493f230f8b5a3ebff (diff)
downloadprosody-fffdba514a7f52494dbc6943da525171d2fd7104.tar.gz
prosody-fffdba514a7f52494dbc6943da525171d2fd7104.zip
net.server: Don't retry if client closes socket during SSL handshaking
Diffstat (limited to 'net/server.lua')
-rw-r--r--net/server.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/server.lua b/net/server.lua
index aacadacc..e895f8aa 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -489,7 +489,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
read, wrote = nil, nil
_, err = client:dohandshake( )
if not err then
- --out_put( "server.lua: ssl handshake done" )
+ out_put( "server.lua: ssl handshake done" )
handler.readbuffer = _readbuffer -- when handshake is done, replace the handshake function with regular functions
handler.sendbuffer = _sendbuffer
-- return dispatch( handler )
@@ -504,12 +504,14 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport
_readlistlen = _readlistlen + 1
_readlist [ _readlistlen ] = client
read = true
+ else
+ break;
end
--coroutine_yield( handler, nil, err ) -- handshake not finished
coroutine_yield( )
end
end
- disconnect( handler, "max handshake attemps exceeded" )
+ disconnect( handler, "ssl handshake failed" )
handler.close( true ) -- forced disconnect
return false -- handshake failed
end