mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 10:41:03 +01:00
Fix panic error in concurrent calling with websocket.Connection.Emit()
Former-commit-id: 4c5cc222e9a43b18a86adb35bfafe4a278fd880e
This commit is contained in:
parent
d2c3b90bc4
commit
1f1dfcca1c
|
@ -357,7 +357,7 @@ func (s *Server) emitMessage(from, to string, data []byte) {
|
|||
s.mu.RUnlock()
|
||||
if room != nil {
|
||||
// it suppose to send the message to a specific room/or a user inside its own room
|
||||
for _, connectionIDInsideRoom := range s.rooms[to] {
|
||||
for _, connectionIDInsideRoom := range room {
|
||||
if c, ok := s.getConnection(connectionIDInsideRoom); ok {
|
||||
c.writeDefault(data) //send the message to the client(s)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user