Commit dec1870b authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

[OPENBUS-2849] Correção para permitir que o 'busservices' atenda novos...

[OPENBUS-2849] Correção para permitir que o 'busservices' atenda novos clientes quando o número de sockets abertos atinge o limite imposto pelo sistema operacional.

git-svn-id: https://subversion.tecgraf.puc-rio.br/engdist/openbus/core/branches/02_00_00@168722 ae0415b3-e90b-0410-900d-d0be9363c56b
parent 5742ccce
......@@ -66,6 +66,7 @@ return function(...)
NoPasswordValidators = 13,
InvalidChallengeTime = 14,
InvalidSharedAuthTime = 15,
InvalidMaximumChannelLimit = 16,
}
-- configuration parameters parser
......@@ -85,7 +86,9 @@ return function(...)
badpasswordtries = 3,
badpasswordlimit = inf,
badpasswordrate = inf,
maxchannels = 0,
admin = {},
validator = {},
......@@ -141,6 +144,8 @@ Options:
-badpasswordlimit <number> nmero mximo de autenticaes simultneas com senha incorreta
-badpasswordrate <number> frequncia mxima de autenticaes com senha incoreta (autenticao/segundo)
-maxchannels <number> nmero mximo de canais de comunicao com os sistemas
-admin <user> usurio com privilgio de administrao
-validator <name> nome de pacote de validao de login
......@@ -241,6 +246,16 @@ Options:
return errcode.InvalidPasswordValidationRate
end
-- validate time parameters
if Configs.maxchannels == 0 then
Configs.maxchannels = nil
elseif Configs.maxchannels < 0 then
log:misconfig(msg.InvalidMaximumChannelLimit:tag{
value = Configs.maxchannels,
})
return errcode.InvalidMaximumChannelLimit
end
-- load private key
local prvkey, errmsg = readprivatekey(Configs.privatekey)
if prvkey == nil then
......@@ -299,10 +314,11 @@ Options:
end
-- setup bus access
local address = { host=Configs.host, port=Configs.port }
log:config(msg.ServicesListeningAddress:tag(address))
address.tcpoptions = {timeout=nil,reuseaddr=true}
local orb = access.initORB(address)
local orbcfg = { host=Configs.host, port=Configs.port }
log:config(msg.ServicesListeningAddress:tag(orbcfg))
orbcfg.tcpoptions = {timeout=nil,reuseaddr=true}
orbcfg.maxchannels = Configs.maxchannels
local orb = access.initORB(orbcfg)
local legacy
if not Configs.nolegacy then
local legacyIDL = require "openbus.core.legacy.idl"
......@@ -368,6 +384,7 @@ Options:
log:config(msg.BadPasswordLimitedTries:tag{limit=Configs.badpasswordtries})
log:config(msg.BadPasswordTotalLimit:tag{value=Configs.badpasswordlimit})
log:config(msg.BadPasswordMaxRate:tag{value=Configs.badpasswordrate})
log:config(msg.MaximumChannelLimit:tag{value=Configs.maxchannels})
if not params.enforceAuth then
log:config(msg.OfferAuthorizationDisabled)
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment