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 | b0249c4d4a286172d1f548d0a65bf6154b34e1e8 (patch) | |
tree | a9b8c080f0a4e219cca5d1a7095b0c913c3fd530 /net | |
parent | 387897f53f142e0cde5f8cffc8d40deae406386c (diff) | |
download | prosody-b0249c4d4a286172d1f548d0a65bf6154b34e1e8.tar.gz prosody-b0249c4d4a286172d1f548d0a65bf6154b34e1e8.zip |
net.server_select: Pause servers while they are full
Diffstat (limited to 'net')
-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 |