Commit 22549b03 authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

Fix race condition issue where listner could become nil

parent 5007b240
...@@ -46,16 +46,16 @@ func (s *Server) Start() error { ...@@ -46,16 +46,16 @@ func (s *Server) Start() error {
} }
// Start accepting connections // Start accepting connections
go func() { go func(l net.Listener) {
for { for {
conn, err := s.listener.Accept() conn, err := l.Accept()
if err != nil { if err != nil {
break break
} }
go s.server.ServeConn(conn) go s.server.ServeConn(conn)
} }
}() }(s.listener)
return nil return nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment