Update mux_bridge.go

This commit is contained in:
snail007
2018-03-12 19:27:37 +08:00
committed by GitHub
parent 9ce3a6e468
commit 4d4fb64b59

View File

@ -120,14 +120,14 @@ func (s *MuxBridge) handler(inConn net.Conn) {
} }
groupKey := keyInfo[0] groupKey := keyInfo[0]
index := keyInfo[1] index := keyInfo[1]
s.l.Lock()
defer s.l.Unlock()
if !s.clientControlConns.Has(groupKey) { if !s.clientControlConns.Has(groupKey) {
item := utils.NewConcurrentMap() item := utils.NewConcurrentMap()
s.clientControlConns.Set(groupKey, &item) s.clientControlConns.Set(groupKey, &item)
} }
_group, _ := s.clientControlConns.Get(groupKey) _group, _ := s.clientControlConns.Get(groupKey)
group := _group.(*utils.ConcurrentMap) group := _group.(*utils.ConcurrentMap)
s.l.Lock()
defer s.l.Unlock()
group.Set(index, session) group.Set(index, session)
// s.clientControlConns.Set(key, session) // s.clientControlConns.Set(key, session)
go func() { go func() {