Software /
code /
prosody
Changeset
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 |
parents | 5279:e8f7962056f5 |
children | 5281:815c689f85ad |
files | net/server_select.lua |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
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