|
@@ -214,16 +214,17 @@ type LineLenLimits struct {
|
214
|
214
|
|
215
|
215
|
// Various server-enforced limits on data size.
|
216
|
216
|
type Limits struct {
|
217
|
|
- AwayLen int `yaml:"awaylen"`
|
218
|
|
- ChanListModes int `yaml:"chan-list-modes"`
|
219
|
|
- ChannelLen int `yaml:"channellen"`
|
220
|
|
- IdentLen int `yaml:"identlen"`
|
221
|
|
- KickLen int `yaml:"kicklen"`
|
222
|
|
- LineLen LineLenLimits `yaml:"linelen"`
|
223
|
|
- MonitorEntries int `yaml:"monitor-entries"`
|
224
|
|
- NickLen int `yaml:"nicklen"`
|
225
|
|
- TopicLen int `yaml:"topiclen"`
|
226
|
|
- WhowasEntries int `yaml:"whowas-entries"`
|
|
217
|
+ AwayLen int `yaml:"awaylen"`
|
|
218
|
+ ChanListModes int `yaml:"chan-list-modes"`
|
|
219
|
+ ChannelLen int `yaml:"channellen"`
|
|
220
|
+ IdentLen int `yaml:"identlen"`
|
|
221
|
+ KickLen int `yaml:"kicklen"`
|
|
222
|
+ LineLen LineLenLimits `yaml:"linelen"`
|
|
223
|
+ MonitorEntries int `yaml:"monitor-entries"`
|
|
224
|
+ NickLen int `yaml:"nicklen"`
|
|
225
|
+ TopicLen int `yaml:"topiclen"`
|
|
226
|
+ WhowasEntries int `yaml:"whowas-entries"`
|
|
227
|
+ RegistrationMessages int `yaml:"registration-messages"`
|
227
|
228
|
}
|
228
|
229
|
|
229
|
230
|
// STSConfig controls the STS configuration/
|
|
@@ -532,6 +533,9 @@ func LoadConfig(filename string) (config *Config, err error) {
|
532
|
533
|
if config.Limits.NickLen < 1 || config.Limits.ChannelLen < 2 || config.Limits.AwayLen < 1 || config.Limits.KickLen < 1 || config.Limits.TopicLen < 1 {
|
533
|
534
|
return nil, ErrLimitsAreInsane
|
534
|
535
|
}
|
|
536
|
+ if config.Limits.RegistrationMessages == 0 {
|
|
537
|
+ config.Limits.RegistrationMessages = 1024
|
|
538
|
+ }
|
535
|
539
|
if config.Server.STS.Enabled {
|
536
|
540
|
config.Server.STS.Duration, err = custime.ParseDuration(config.Server.STS.DurationString)
|
537
|
541
|
if err != nil {
|