From e35a116188fe321ba64e024f9b5d5ec958475ec2 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 16 Mar 2021 18:25:21 +0100 Subject: [PATCH] Don't update downstream caps in upstream RPL_WELCOME handler Prior to being registered, upstreamConn.handleMessage doesn't run in the user goroutine, it runs in a goroutine specific to the network. Thus we shouldn't access any user data structure from there. downstreamConn.updateSupportedCaps is already called from the eventUpstreamConnected handler in user.run, the call being removed was unnecessary. Closes: https://todo.sr.ht/~emersion/soju/108 --- upstream.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/upstream.go b/upstream.go index 8aac040..d5ba66b 100644 --- a/upstream.go +++ b/upstream.go @@ -590,10 +590,6 @@ func (uc *upstreamConn) handleMessage(msg *irc.Message) error { uc.registered = true uc.logger.Printf("connection registered") - uc.forEachDownstream(func(dc *downstreamConn) { - dc.updateSupportedCaps() - }) - if len(uc.network.channels) > 0 { var channels, keys []string for _, ch := range uc.network.channels {