forked from External/ergo
channel: RWMutex for members access
This commit is contained in:
parent
efb3000717
commit
6f7c683247
5 changed files with 69 additions and 0 deletions
|
|
@ -345,6 +345,9 @@ func cmodeHandler(server *Server, client *Client, msg ircmsg.IrcMessage) bool {
|
|||
channelName, err := CasefoldChannel(msg.Params[0])
|
||||
channel := server.channels.Get(channelName)
|
||||
|
||||
channel.membersMutex.Lock()
|
||||
defer channel.membersMutex.Unlock()
|
||||
|
||||
if err != nil || channel == nil {
|
||||
client.Send(nil, server.name, ERR_NOSUCHCHANNEL, client.nick, msg.Params[0], "No such channel")
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue