Browse Source

WHOWAS: Make maximum number of entries configurable

tags/v0.1.0
Daniel Oaks 8 years ago
parent
commit
43553390d6
5 changed files with 10 additions and 5 deletions
  1. 2
    1
      CHANGELOG.md
  2. 3
    2
      irc/config.go
  3. 1
    1
      irc/server.go
  4. 1
    1
      irc/whowas.go
  5. 3
    0
      oragono.yaml

+ 2
- 1
CHANGELOG.md View File

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

+ 3
- 2
irc/config.go View File

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

+ 1
- 1
irc/server.go View File

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

+ 1
- 1
irc/whowas.go View File

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

+ 3
- 0
oragono.yaml View File

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

Loading…
Cancel
Save