Software /
code /
prosody
Diff
net/server_select.lua @ 5280:1514a6147e85
net.server_select: Pause servers while they are full
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 28 Dec 2012 14:33:27 +0100 |
parent | 5279:e8f7962056f5 |
child | 5288:2777f34adbd3 |
line wrap: on
line diff
--- a/net/server_select.lua Fri Dec 28 14:33:27 2012 +0100 +++ b/net/server_select.lua Fri Dec 28 14:33:27 2012 +0100 @@ -185,6 +185,9 @@ end handler.remove = function( ) connections = connections - 1 + if handler then + handler.resume( ) + end end handler.close = function() socket:close( ) @@ -227,6 +230,7 @@ end handler.readbuffer = function( ) if connections > maxconnections then + handler.pause( ) out_put( "server.lua: refused new client connection: server full" ) return false end