Changeset 279 in code


Ignore:
Timestamp:
Apr 30, 2020, 8:25:16 AM (5 years ago)
Author:
contact
Message:

Remove network.upstream

This is an artifact from when we used locks. No need for this anymore.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/downstream.go

    r278 r279  
    135135                return nil
    136136        }
    137         return dc.network.upstream()
     137        return dc.network.conn
    138138}
    139139
  • trunk/service.go

    r271 r279  
    246246                var statuses []string
    247247                var details string
    248                 if uc := net.upstream(); uc != nil {
     248                if uc := net.conn; uc != nil {
    249249                        if dc.nick != uc.nick {
    250250                                statuses = append(statuses, "connected as "+uc.nick)
  • trunk/user.go

    r276 r279  
    130130}
    131131
    132 func (net *network) upstream() *upstreamConn {
    133         return net.conn
    134 }
    135 
    136132func (net *network) Stop() {
    137133        select {
     
    142138        }
    143139
    144         if uc := net.upstream(); uc != nil {
    145                 uc.Close()
     140        if net.conn != nil {
     141                net.conn.Close()
    146142        }
    147143}
     
    201197func (u *user) forEachUpstream(f func(uc *upstreamConn)) {
    202198        for _, network := range u.networks {
    203                 uc := network.upstream()
    204                 if uc == nil {
     199                if network.conn == nil {
    205200                        continue
    206201                }
    207                 f(uc)
     202                f(network.conn)
    208203        }
    209204}
Note: See TracChangeset for help on using the changeset viewer.