1
0
Fork 0
forked from External/ergo

Merge pull request #218 from slingamn/socketwriter.1

refactor irc.Socket
This commit is contained in:
Shivaram Lingamneni 2018-03-28 13:26:03 -04:00 committed by GitHub
commit 7cfa75a59e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 90 additions and 125 deletions

View file

@ -216,7 +216,7 @@ type Config struct {
ProxyAllowedFrom []string `yaml:"proxy-allowed-from"`
WebIRC []webircConfig `yaml:"webirc"`
MaxSendQString string `yaml:"max-sendq"`
MaxSendQBytes uint64
MaxSendQBytes int
ConnectionLimiter connection_limits.LimiterConfig `yaml:"connection-limits"`
ConnectionThrottler connection_limits.ThrottlerConfig `yaml:"connection-throttling"`
}
@ -530,10 +530,11 @@ func LoadConfig(filename string) (config *Config, err error) {
}
}
config.Server.MaxSendQBytes, err = bytefmt.ToBytes(config.Server.MaxSendQString)
maxSendQBytes, err := bytefmt.ToBytes(config.Server.MaxSendQString)
if err != nil {
return nil, fmt.Errorf("Could not parse maximum SendQ size (make sure it only contains whole numbers): %s", err.Error())
}
config.Server.MaxSendQBytes = int(maxSendQBytes)
// get language files
config.Languages.Data = make(map[string]languages.LangData)