aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-12-28 14:33:27 +0100
committerKim Alvefur <zash@zash.se>2012-12-28 14:33:27 +0100
commitde47f7e8361773e32f8278c6ae305e1a08636285 (patch)
treea9b8c080f0a4e219cca5d1a7095b0c913c3fd530
parentf2af5505314d8b8502fb1bc5b9549abfa7376b89 (diff)
downloadprosody-de47f7e8361773e32f8278c6ae305e1a08636285.tar.gz
prosody-de47f7e8361773e32f8278c6ae305e1a08636285.zip
net.server_select: Pause servers while they are full
-rw-r--r--net/server_select.lua4
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