- Timestamp:
- Mar 16, 2020, 1:28:45 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r104 r105 7 7 "net" 8 8 "strings" 9 "sync" 9 10 "time" 10 11 … … 70 71 password string // empty after authentication 71 72 network *network // can be nil 73 74 lock sync.Mutex 75 ourMessages map[*irc.Message]struct{} 72 76 } 73 77 … … 81 85 ringMessages: make(chan ringMessage), 82 86 closed: make(chan struct{}), 87 ourMessages: make(map[*irc.Message]struct{}), 83 88 } 84 89 … … 230 235 break 231 236 } 237 238 dc.lock.Lock() 239 _, ours := dc.ourMessages[msg] 240 delete(dc.ourMessages, msg) 241 dc.lock.Unlock() 242 if ours { 243 // The message comes from our connection, don't echo it 244 // back 245 continue 246 } 247 232 248 msg = msg.Copy() 233 249 switch msg.Command { … … 639 655 Params: []string{upstreamName, text}, 640 656 }) 657 658 dc.lock.Lock() 659 dc.ourMessages[msg] = struct{}{} 660 dc.lock.Unlock() 661 662 uc.ring.Produce(msg) 641 663 } 642 664 default:
Note:
See TracChangeset
for help on using the changeset viewer.