diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-28 14:33:27 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-28 14:33:27 +0100 |
commit | de47f7e8361773e32f8278c6ae305e1a08636285 (patch) | |
tree | a9b8c080f0a4e219cca5d1a7095b0c913c3fd530 /net/server_select.lua | |
parent | f2af5505314d8b8502fb1bc5b9549abfa7376b89 (diff) | |
download | prosody-de47f7e8361773e32f8278c6ae305e1a08636285.tar.gz prosody-de47f7e8361773e32f8278c6ae305e1a08636285.zip |
net.server_select: Pause servers while they are full
Diffstat (limited to 'net/server_select.lua')
-rw-r--r-- | net/server_select.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/server_select.lua b/net/server_select.lua index 97c29b8c..97b9f199 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -185,6 +185,9 @@ wrapserver = function( listeners, socket, ip, serverport, pattern, sslctx, maxco end handler.remove = function( ) connections = connections - 1 + if handler then + handler.resume( ) + end end handler.close = function() socket:close( ) @@ -227,6 +230,7 @@ wrapserver = function( listeners, socket, ip, serverport, pattern, sslctx, maxco end handler.readbuffer = function( ) if connections > maxconnections then + handler.pause( ) out_put( "server.lua: refused new client connection: server full" ) return false end |