forked from External/ergo
socket: Very initial SendQ limit
This commit is contained in:
parent
de4db1c6ef
commit
f29a5f0e70
5 changed files with 44 additions and 2 deletions
|
|
@ -14,6 +14,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"code.cloudfoundry.org/bytefmt"
|
||||
|
||||
"github.com/DanielOaks/oragono/irc/custime"
|
||||
"github.com/DanielOaks/oragono/irc/logger"
|
||||
"gopkg.in/yaml.v2"
|
||||
|
|
@ -171,6 +173,8 @@ type Config struct {
|
|||
RestAPI RestAPIConfig `yaml:"rest-api"`
|
||||
CheckIdent bool `yaml:"check-ident"`
|
||||
MOTD string
|
||||
MaxSendQString string `yaml:"max-sendq"`
|
||||
MaxSendQBytes uint64
|
||||
ConnectionLimits ConnectionLimitsConfig `yaml:"connection-limits"`
|
||||
ConnectionThrottle ConnectionThrottleConfig `yaml:"connection-throttling"`
|
||||
}
|
||||
|
|
@ -433,5 +437,10 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
}
|
||||
config.Logging = newLogConfigs
|
||||
|
||||
config.Server.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())
|
||||
}
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue