- Timestamp:
- Mar 27, 2020, 11:51:58 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r177 r179 1081 1081 // TODO: support ELIST when supported by all upstreams 1082 1082 1083 dc.user.pendingLISTsLock.Lock()1084 defer dc.user.pendingLISTsLock.Unlock()1085 1086 1083 pl := pendingLIST{ 1087 1084 downstreamID: dc.id, -
trunk/upstream.go
r178 r179 64 64 65 65 // set of LIST commands in progress, per downstream 66 // access is synchronized with user.pendingLISTsLock67 66 pendingLISTDownstreamSet map[uint64]struct{} 68 67 … … 152 151 } 153 152 close(uc.closed) 154 for _, log := range uc.logs {155 log.file.Close()156 }157 uc.endPendingLists(true)158 153 return nil 159 154 } … … 193 188 194 189 func (uc *upstreamConn) getPendingList() *pendingLIST { 195 uc.user.pendingLISTsLock.Lock()196 defer uc.user.pendingLISTsLock.Unlock()197 190 for _, pl := range uc.user.pendingLISTs { 198 191 if _, ok := pl.pendingCommands[uc.network.ID]; !ok { … … 206 199 func (uc *upstreamConn) endPendingLists(all bool) (found bool) { 207 200 found = false 208 uc.user.pendingLISTsLock.Lock()209 defer uc.user.pendingLISTsLock.Unlock()210 201 for i := 0; i < len(uc.user.pendingLISTs); i++ { 211 202 pl := uc.user.pendingLISTs[i] -
trunk/user.go
r177 r179 13 13 msg *irc.Message 14 14 uc *upstreamConn 15 } 16 17 type eventUpstreamDisconnected struct { 18 uc *upstreamConn 15 19 } 16 20 … … 76 80 } 77 81 uc.Close() 82 net.user.events <- eventUpstreamDisconnected{uc} 78 83 79 84 net.lock.Lock() … … 99 104 100 105 // LIST commands in progress 101 pendingLISTsLock sync.Mutex 102 pendingLISTs []pendingLIST 106 pendingLISTs []pendingLIST 103 107 } 104 108 … … 164 168 for e := range u.events { 165 169 switch e := e.(type) { 170 case eventUpstreamDisconnected: 171 uc := e.uc 172 for _, log := range uc.logs { 173 log.file.Close() 174 } 175 uc.endPendingLists(true) 166 176 case eventUpstreamMessage: 167 177 msg, uc := e.msg, e.uc
Note:
See TracChangeset
for help on using the changeset viewer.