Fix LuCId behaviour if thread-limit is reached
[project/luci.git] / libs / lucid / luasrc / lucid / tcpserver.lua
index 2897ec8eaa98da20164107b9a874ff0cd2a3e75a..47748e4a3ebe161cf84326f5ea346c9b2a0fe901 100644 (file)
@@ -111,6 +111,9 @@ end
 -- @param polle Poll descriptor
 -- @return handler process id or nil, error code, error message 
 function accept(polle)
+       if not lucid.try_process() then
+               return false
+       end
        local socket, host, port = polle.fd:accept()
        if not socket then
                return nixio.syslog("warn", "accept() failed: " .. port)