Remove network.upstream
This is an artifact from when we used locks. No need for this anymore.
This commit is contained in:
parent
c4655f1492
commit
e7e4311160
@ -134,7 +134,7 @@ func (dc *downstreamConn) upstream() *upstreamConn {
|
|||||||
if dc.network == nil {
|
if dc.network == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return dc.network.upstream()
|
return dc.network.conn
|
||||||
}
|
}
|
||||||
|
|
||||||
func isOurNick(net *network, nick string) bool {
|
func isOurNick(net *network, nick string) bool {
|
||||||
|
@ -245,7 +245,7 @@ func handleServiceNetworkStatus(dc *downstreamConn, params []string) error {
|
|||||||
dc.user.forEachNetwork(func(net *network) {
|
dc.user.forEachNetwork(func(net *network) {
|
||||||
var statuses []string
|
var statuses []string
|
||||||
var details string
|
var details string
|
||||||
if uc := net.upstream(); uc != nil {
|
if uc := net.conn; uc != nil {
|
||||||
if dc.nick != uc.nick {
|
if dc.nick != uc.nick {
|
||||||
statuses = append(statuses, "connected as "+uc.nick)
|
statuses = append(statuses, "connected as "+uc.nick)
|
||||||
} else {
|
} else {
|
||||||
|
13
user.go
13
user.go
@ -129,10 +129,6 @@ func (net *network) run() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (net *network) upstream() *upstreamConn {
|
|
||||||
return net.conn
|
|
||||||
}
|
|
||||||
|
|
||||||
func (net *network) Stop() {
|
func (net *network) Stop() {
|
||||||
select {
|
select {
|
||||||
case <-net.stopped:
|
case <-net.stopped:
|
||||||
@ -141,8 +137,8 @@ func (net *network) Stop() {
|
|||||||
close(net.stopped)
|
close(net.stopped)
|
||||||
}
|
}
|
||||||
|
|
||||||
if uc := net.upstream(); uc != nil {
|
if net.conn != nil {
|
||||||
uc.Close()
|
net.conn.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,11 +196,10 @@ func (u *user) forEachNetwork(f func(*network)) {
|
|||||||
|
|
||||||
func (u *user) forEachUpstream(f func(uc *upstreamConn)) {
|
func (u *user) forEachUpstream(f func(uc *upstreamConn)) {
|
||||||
for _, network := range u.networks {
|
for _, network := range u.networks {
|
||||||
uc := network.upstream()
|
if network.conn == nil {
|
||||||
if uc == nil {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
f(uc)
|
f(network.conn)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user