From ac38ef02585a8bcf6cada5171fe0a5953a34d683 Mon Sep 17 00:00:00 2001 From: "kayos@tcp.direct" Date: Sat, 19 Mar 2022 13:25:56 -0700 Subject: [PATCH] Fix: SASL not firing off --- builtin.go | 4 ++-- handler.go | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/builtin.go b/builtin.go index 5257ffb..35706b4 100644 --- a/builtin.go +++ b/builtin.go @@ -17,8 +17,8 @@ import ( func (c *Client) registerBuiltins() { c.debug.Print("registering built-in handlers") - c.mu.Lock() - defer c.mu.Unlock() + c.Handlers.mu.Lock() + defer c.Handlers.mu.Unlock() // Built-in things that should always be supported. c.Handlers.register(true, true, RPL_WELCOME, HandlerFunc(handleConnect)) diff --git a/handler.go b/handler.go index fce8f29..b543300 100644 --- a/handler.go +++ b/handler.go @@ -214,6 +214,8 @@ type execStack struct { // Please note that there is no specific order/priority for which the handlers // are executed. func (c *Caller) exec(command string, bg bool, client *Client, event *Event) { + c.mu.RLock() + defer c.mu.RUnlock() // Build a stack of handlers which can be executed concurrently. var stack []execStack