1
0
Fork 0
forked from External/ergo

load isupport directly into the config object

eliminates Server.configurableStateMutex
This commit is contained in:
Shivaram Lingamneni 2019-05-10 00:27:28 -04:00
parent 61d666a25b
commit ce6a3e42df
5 changed files with 49 additions and 58 deletions

View file

@ -20,6 +20,7 @@ import (
"code.cloudfoundry.org/bytefmt"
"github.com/oragono/oragono/irc/connection_limits"
"github.com/oragono/oragono/irc/custime"
"github.com/oragono/oragono/irc/isupport"
"github.com/oragono/oragono/irc/languages"
"github.com/oragono/oragono/irc/logger"
"github.com/oragono/oragono/irc/modes"
@ -293,6 +294,7 @@ type Config struct {
forceTrailing bool
SendUnprefixedSasl bool `yaml:"send-unprefixed-sasl"`
}
isupport isupport.List
ConnectionLimiter connection_limits.LimiterConfig `yaml:"connection-limits"`
ConnectionThrottler connection_limits.ThrottlerConfig `yaml:"connection-throttling"`
}
@ -713,6 +715,11 @@ func LoadConfig(filename string) (config *Config, err error) {
config.loadMOTD()
err = config.generateISupport()
if err != nil {
return nil, err
}
// in the current implementation, we disable history by creating a history buffer
// with zero capacity. but the `enabled` config option MUST be respected regardless
// of this detail