Diff

net/server_select.lua @ 5663:4e51ceee469c

net.server_select: Make sure there is a server to pause when hitting maxfd (Thanks elghinn)
author Kim Alvefur <zash@zash.se>
date Sun, 09 Jun 2013 17:00:26 +0200
parent 5642:5862bb57a3f1
child 5664:4f499eb63c04
child 5949:a9abbdeddbf3
line wrap: on
line diff
--- a/net/server_select.lua	Fri Jun 07 13:22:13 2013 +0100
+++ b/net/server_select.lua	Sun Jun 09 17:00:26 2013 +0200
@@ -263,7 +263,9 @@
 	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 )