diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-10-04 16:03:53 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-10-04 16:03:53 +0100 |
commit | 559f264f4b3556aee0fb33dd083437f3268fd90a (patch) | |
tree | 4674088394469e3efa07bd5533684bf63762a281 | |
parent | 2be1fcb5af83188bda53dc4e92c7be8e0506a502 (diff) | |
download | prosody-559f264f4b3556aee0fb33dd083437f3268fd90a.tar.gz prosody-559f264f4b3556aee0fb33dd083437f3268fd90a.zip |
net.server: Increase SSL handshake round-trip limit, and make it configurable
-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 fb05e817..38d0eab5 100644 --- a/net/server.lua +++ b/net/server.lua @@ -157,6 +157,7 @@ _cleanqueue = false -- clean bufferqueue after using _maxclientsperserver = 1000
+_maxsslhandshake = 30 -- max handshake round-trips
----------------------------------// PRIVATE //--
wrapserver = function( listeners, socket, ip, serverport, pattern, sslctx, maxconnections, startssl ) -- this function wraps a server
@@ -534,7 +535,7 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport local read
local handshake = coroutine_wrap( function( client ) -- create handshake coroutine
local err
- for i = 1, 10 do -- 10 handshake attemps
+ for i = 1, _maxsslhandshake do
_sendlistlen = ( wrote and removesocket( _sendlist, socket, _sendlistlen ) ) or _sendlistlen
_readlistlen = ( read and removesocket( _readlist, socket, _readlistlen ) ) or _readlistlen
read, wrote = nil, nil
@@ -751,7 +752,7 @@ closeall = function( ) end
getsettings = function( )
- return _selecttimeout, _sleeptime, _maxsendlen, _maxreadlen, _checkinterval, _sendtimeout, _readtimeout, _cleanqueue, _maxclientsperserver
+ return _selecttimeout, _sleeptime, _maxsendlen, _maxreadlen, _checkinterval, _sendtimeout, _readtimeout, _cleanqueue, _maxclientsperserver, _maxsslhandshake
end
changesettings = function( new )
@@ -767,6 +768,7 @@ changesettings = function( new ) _readtimeout = tonumber( new.readtimeout ) or _readtimeout
_cleanqueue = new.cleanqueue
_maxclientsperserver = new._maxclientsperserver or _maxclientsperserver
+ _maxsslhandshake = new._maxsslhandshake or _maxsslhandshake
return true
end
|