Fix panic in downstreamConn.sendNetworkHistory
This panic happens when sending history to a multi-upstream client. sendNetworkHistory is called on each network, but dc.network is nil. Closes: https://todo.sr.ht/~emersion/soju/93
This commit is contained in:
parent
43aa3e5529
commit
480d771a67
@ -886,7 +886,7 @@ func (dc *downstreamConn) sendNetworkHistory(net *network) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
limit := 4000
|
limit := 4000
|
||||||
history, err := loadHistoryLatestID(dc.network, target, lastDelivered, limit)
|
history, err := loadHistoryLatestID(net, target, lastDelivered, limit)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
dc.logger.Printf("failed to send implicit history for %q: %v", target, err)
|
dc.logger.Printf("failed to send implicit history for %q: %v", target, err)
|
||||||
continue
|
continue
|
||||||
@ -970,7 +970,7 @@ func (dc *downstreamConn) handleMessageRegistered(msg *irc.Message) error {
|
|||||||
if destination != "" && destination != dc.srv.Hostname {
|
if destination != "" && destination != dc.srv.Hostname {
|
||||||
return ircError{&irc.Message{
|
return ircError{&irc.Message{
|
||||||
Command: irc.ERR_NOSUCHSERVER,
|
Command: irc.ERR_NOSUCHSERVER,
|
||||||
Params: []string{dc.nick, destination, "No such server"},
|
Params: []string{dc.nick, destination, "No such server"},
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
dc.SendMessage(&irc.Message{
|
dc.SendMessage(&irc.Message{
|
||||||
|
Loading…
Reference in New Issue
Block a user