3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-14 07:59:31 +01:00

WHOWAS: Make maximum number of entries configurable

This commit is contained in:
Daniel Oaks 2016-08-14 14:07:50 +10:00
parent 6e66c5c8a7
commit 43553390d6
5 changed files with 10 additions and 5 deletions

View File

@ -27,9 +27,10 @@ Initial release of Oragono!
* Changed private (`+p`) channel mode to secret (`+s`), to match what's used by servers today. * Changed private (`+p`) channel mode to secret (`+s`), to match what's used by servers today.
* Changed default channel modes to (`+nt`), matching most other IRCds. * Changed default channel modes to (`+nt`), matching most other IRCds.
* Changed CLI commands and arguments to be more consistent with typical software. * Changed CLI commands and arguments to be more consistent with typical software.
* Changed maximum nickname and channel name lengths to be configurable.
* Changed usernames set by the `USER` command to start with `"~"` (to work with new ident support). * Changed usernames set by the `USER` command to start with `"~"` (to work with new ident support).
* Renamed `ONICK` command to `SANICK` to be more consistent with other IRCds. * Renamed `ONICK` command to `SANICK` to be more consistent with other IRCds.
* Made maximum nickname and channel name lengths configurable.
* Made maximum `WHOWAS` entries configurable.
### Removed ### Removed
* Removed gitconfig configuration format [replaced with YAML]. * Removed gitconfig configuration format [replaced with YAML].

View File

@ -68,8 +68,9 @@ type Config struct {
Theater map[string]*PassConfig Theater map[string]*PassConfig
Limits struct { Limits struct {
NickLen int `yaml:"nicklen"` NickLen int `yaml:"nicklen"`
ChannelLen int `yaml:"channellen"` ChannelLen int `yaml:"channellen"`
WhowasEntries uint `yaml:"whowas-entries"`
} }
} }

View File

@ -69,7 +69,7 @@ func NewServer(config *Config) *Server {
operators: config.Operators(), operators: config.Operators(),
signals: make(chan os.Signal, len(SERVER_SIGNALS)), signals: make(chan os.Signal, len(SERVER_SIGNALS)),
proxyAllowedFrom: config.Server.ProxyAllowedFrom, proxyAllowedFrom: config.Server.ProxyAllowedFrom,
whoWas: NewWhoWasList(100), whoWas: NewWhoWasList(config.Limits.WhowasEntries),
theaters: config.Theaters(), theaters: config.Theaters(),
checkIdent: config.Server.CheckIdent, checkIdent: config.Server.CheckIdent,
} }

View File

@ -18,7 +18,7 @@ type WhoWas struct {
func NewWhoWasList(size uint) *WhoWasList { func NewWhoWasList(size uint) *WhoWasList {
return &WhoWasList{ return &WhoWasList{
buffer: make([]*WhoWas, size), buffer: make([]*WhoWas, size+1),
} }
} }

View File

@ -64,3 +64,6 @@ limits:
# channellen is the max channel length allowed # channellen is the max channel length allowed
channellen: 64 channellen: 64
# whowas entries to store
whowas-entries: 100