Changeset 131 in code
- Timestamp:
- Mar 20, 2020, 9:48:17 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r130 r131 709 709 var seqPtr *uint64 710 710 if firstDownstream { 711 uc. lock.Lock()712 seq, ok := uc. history[historyName]713 uc. lock.Unlock()711 uc.network.lock.Lock() 712 seq, ok := uc.network.history[historyName] 713 uc.network.lock.Unlock() 714 714 if ok { 715 715 seqPtr = &seq … … 739 739 740 740 if lastDownstream { 741 uc. lock.Lock()742 uc. history[historyName] = seq743 uc. lock.Unlock()741 uc.network.lock.Lock() 742 uc.network.history[historyName] = seq 743 uc.network.lock.Unlock() 744 744 } 745 745 }() -
trunk/upstream.go
r129 r131 9 9 "strconv" 10 10 "strings" 11 "sync"12 11 "time" 13 12 … … 54 53 saslClient sasl.Client 55 54 saslStarted bool 56 57 lock sync.Mutex58 history map[string]uint64 // TODO: move to network59 55 } 60 56 … … 86 82 ring: NewRing(network.user.srv.RingCap), 87 83 channels: make(map[string]*upstreamChannel), 88 history: make(map[string]uint64),89 84 caps: make(map[string]string), 90 85 } -
trunk/user.go
r120 r131 21 21 Network 22 22 user *user 23 conn *upstreamConn 23 24 lock sync.Mutex 25 conn *upstreamConn 26 history map[string]uint64 24 27 } 25 28 … … 28 31 Network: *record, 29 32 user: user, 33 history: make(map[string]uint64), 30 34 } 31 35 } … … 49 53 uc.register() 50 54 51 net. user.lock.Lock()55 net.lock.Lock() 52 56 net.conn = uc 53 net. user.lock.Unlock()57 net.lock.Unlock() 54 58 55 59 if err := uc.readMessages(net.user.upstreamIncoming); err != nil { … … 58 62 uc.Close() 59 63 60 net. user.lock.Lock()64 net.lock.Lock() 61 65 net.conn = nil 62 net. user.lock.Unlock()66 net.lock.Unlock() 63 67 } 64 68 } … … 96 100 u.lock.Lock() 97 101 for _, network := range u.networks { 102 network.lock.Lock() 98 103 uc := network.conn 104 network.lock.Unlock() 105 99 106 if uc == nil || !uc.registered || uc.closed { 100 107 continue
Note:
See TracChangeset
for help on using the changeset viewer.