diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-03-01 23:33:41 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-03-01 23:33:41 +0000 |
commit | fffdba514a7f52494dbc6943da525171d2fd7104 (patch) | |
tree | 0123f77f0a3ed8959c4506547e743d1b4367146a /net | |
parent | 1c998c518c525feb7555f6c493f230f8b5a3ebff (diff) | |
download | prosody-fffdba514a7f52494dbc6943da525171d2fd7104.tar.gz prosody-fffdba514a7f52494dbc6943da525171d2fd7104.zip |
net.server: Don't retry if client closes socket during SSL handshaking
Diffstat (limited to 'net')
-rw-r--r-- | net/server.lua | 6 |
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
|