mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
more default options, fixed tests
This commit is contained in:
@@ -33,7 +33,7 @@ func createClientAsync(ch chan *client, s *Server, cli net.Conn) {
|
||||
func rawSetup() (*Server, *client, *bufio.Reader, string) {
|
||||
cli, srv := net.Pipe()
|
||||
cr := bufio.NewReaderSize(cli, defaultBufSize)
|
||||
s := New()
|
||||
s := New(Options{})
|
||||
ch := make(chan *client)
|
||||
createClientAsync(ch, s, srv)
|
||||
l, _ := cr.ReadString('\n')
|
||||
|
||||
@@ -43,6 +43,12 @@ type Server struct {
|
||||
}
|
||||
|
||||
func optionDefaults(opt *Options) {
|
||||
if opt.Host == "" {
|
||||
opt.Host = DEFAULT_HOST
|
||||
}
|
||||
if opt.Port == 0 {
|
||||
opt.Port = DEFAULT_PORT
|
||||
}
|
||||
if opt.MaxConn == 0 {
|
||||
opt.MaxConn = DEFAULT_MAX_CONNECTIONS
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user