mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 22:03:10 -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 {
|
func (s *ServerACLs) IsServerBannedFromRoom(serverNameAndPort gomatrixserverlib.ServerName, roomID string) bool {
|
||||||
|
s.aclsMutex.RLock()
|
||||||
acls, ok := s.acls[roomID]
|
acls, ok := s.acls[roomID]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
s.aclsMutex.RUnlock()
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
s.aclsMutex.RUnlock()
|
||||||
serverName, _, err := net.SplitHostPort(string(serverNameAndPort))
|
serverName, _, err := net.SplitHostPort(string(serverNameAndPort))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return true
|
return true
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue