mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 13:53:09 -06:00
Use read mutex
This commit is contained in:
parent
695649f329
commit
8a62fb06eb
|
|
@ -85,10 +85,13 @@ func (s *ServerACLs) OnServerACLUpdate(state *gomatrixserverlib.Event) {
|
|||
}
|
||||
|
||||
func (s *ServerACLs) IsServerBannedFromRoom(serverNameAndPort gomatrixserverlib.ServerName, roomID string) bool {
|
||||
s.aclsMutex.RLock()
|
||||
acls, ok := s.acls[roomID]
|
||||
if !ok {
|
||||
s.aclsMutex.RUnlock()
|
||||
return false
|
||||
}
|
||||
s.aclsMutex.RUnlock()
|
||||
serverName, _, err := net.SplitHostPort(string(serverNameAndPort))
|
||||
if err != nil {
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in a new issue