Changeset 279 in code
- Timestamp:
- Apr 30, 2020, 8:25:16 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/downstream.go
r278 r279 135 135 return nil 136 136 } 137 return dc.network. upstream()137 return dc.network.conn 138 138 } 139 139 -
trunk/service.go
r271 r279 246 246 var statuses []string 247 247 var details string 248 if uc := net. upstream(); uc != nil {248 if uc := net.conn; uc != nil { 249 249 if dc.nick != uc.nick { 250 250 statuses = append(statuses, "connected as "+uc.nick) -
trunk/user.go
r276 r279 130 130 } 131 131 132 func (net *network) upstream() *upstreamConn {133 return net.conn134 }135 136 132 func (net *network) Stop() { 137 133 select { … … 142 138 } 143 139 144 if uc := net.upstream(); uc!= nil {145 uc.Close()140 if net.conn != nil { 141 net.conn.Close() 146 142 } 147 143 } … … 201 197 func (u *user) forEachUpstream(f func(uc *upstreamConn)) { 202 198 for _, network := range u.networks { 203 uc := network.upstream() 204 if uc == nil { 199 if network.conn == nil { 205 200 continue 206 201 } 207 f( uc)202 f(network.conn) 208 203 } 209 204 }
Note:
See TracChangeset
for help on using the changeset viewer.