Split user.register into two functions, one to make sure the user is
authenticated, the other to send our current state. This allows to get
rid of data races by doing the second part in the user goroutine.
Closes: https://todo.sr.ht/~emersion/soju/22
git-svn-id: file:///srv/svn/repo/suika/trunk@168 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This should remove the need for protecting user.downstreamConns with a
mutex.
git-svn-id: file:///srv/svn/repo/suika/trunk@167 f0ae65fe-ee39-954e-97ec-027ff2717ef4
In a later commit, we'll be able to move part of downstreamConn.register
into the user goroutine to prevent races.
References: https://todo.sr.ht/~emersion/soju/22
git-svn-id: file:///srv/svn/repo/suika/trunk@166 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This allows to easily add new events, and also guarantees ordering
between different event types.
git-svn-id: file:///srv/svn/repo/suika/trunk@165 f0ae65fe-ee39-954e-97ec-027ff2717ef4
This allows message handlers to read upstream/downstream connection
information without causing any race condition.
References: https://todo.sr.ht/~emersion/soju/1
git-svn-id: file:///srv/svn/repo/suika/trunk@103 f0ae65fe-ee39-954e-97ec-027ff2717ef4