From d7d15e2ec79c83f13e4dd8bf7c52db658290d336 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 9 Jun 2013 17:00:26 +0200 Subject: net.server_select: Make sure there is a server to pause when hitting maxfd (Thanks elghinn) --- net/server_select.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/server_select.lua b/net/server_select.lua index a6e91d0b..d0894715 100644 --- a/net/server_select.lua +++ b/net/server_select.lua @@ -263,7 +263,9 @@ wrapconnection = function( server, listeners, socket, ip, serverport, clientport if socket:getfd() >= _maxfd then out_error("server.lua: Disallowed FD number: "..socket:getfd()) -- PROTIP: Switch to libevent socket:close( ) -- Should we send some kind of error here? - server.pause( ) + if server then + server.pause( ) + end return nil, nil, "fd-too-large" end socket:settimeout( 0 ) -- cgit v1.2.3