Better race condition prevention

This commit is contained in:
Dane Everitt
2020-04-10 18:22:18 -07:00
parent 17d204a631
commit 03045c94be
9 changed files with 99 additions and 81 deletions

View File

@@ -227,7 +227,7 @@ func (h *Handler) HandleInbound(m Message) error {
// On every authentication event, send the current server status back
// to the client. :)
h.server.Events().Publish(server.StatusEvent, h.server.State)
h.server.Events().Publish(server.StatusEvent, h.server.GetState())
h.unsafeSendJson(Message{
Event: AuthenticationSuccessEvent,
@@ -293,7 +293,7 @@ func (h *Handler) HandleInbound(m Message) error {
return nil
}
if h.server.State == server.ProcessOfflineState {
if h.server.GetState() == server.ProcessOfflineState {
return nil
}