mirror of
https://github.com/jeremyd/ergo.git
synced 2026-07-05 00:03:36 -07:00
WHOWAS: Make maximum number of entries configurable
This commit is contained in:
+3
-2
@@ -68,8 +68,9 @@ type Config struct {
|
||||
Theater map[string]*PassConfig
|
||||
|
||||
Limits struct {
|
||||
NickLen int `yaml:"nicklen"`
|
||||
ChannelLen int `yaml:"channellen"`
|
||||
NickLen int `yaml:"nicklen"`
|
||||
ChannelLen int `yaml:"channellen"`
|
||||
WhowasEntries uint `yaml:"whowas-entries"`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ func NewServer(config *Config) *Server {
|
||||
operators: config.Operators(),
|
||||
signals: make(chan os.Signal, len(SERVER_SIGNALS)),
|
||||
proxyAllowedFrom: config.Server.ProxyAllowedFrom,
|
||||
whoWas: NewWhoWasList(100),
|
||||
whoWas: NewWhoWasList(config.Limits.WhowasEntries),
|
||||
theaters: config.Theaters(),
|
||||
checkIdent: config.Server.CheckIdent,
|
||||
}
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ type WhoWas struct {
|
||||
|
||||
func NewWhoWasList(size uint) *WhoWasList {
|
||||
return &WhoWasList{
|
||||
buffer: make([]*WhoWas, size),
|
||||
buffer: make([]*WhoWas, size+1),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user