mirror of
https://github.com/daeuniverse/dae.git
synced 2025-01-03 13:31:00 +07:00
fix: panic when dialer switching from nil old dialer
This commit is contained in:
parent
55301897e0
commit
e269c4bf60
@ -168,17 +168,21 @@ func (a *AliveDialerSet) NotifyLatencyChange(dialer *Dialer, alive bool) {
|
||||
if a.minLatency.dialer != bakOldBestDialer {
|
||||
if currentAlive {
|
||||
re := "re-"
|
||||
var oldDialerName string
|
||||
if bakOldBestDialer == nil {
|
||||
// Not alive -> alive
|
||||
defer a.aliveChangeCallback(true)
|
||||
re = ""
|
||||
oldDialerName = "<nil>"
|
||||
} else {
|
||||
oldDialerName = bakOldBestDialer.Name()
|
||||
}
|
||||
a.log.WithFields(logrus.Fields{
|
||||
string(a.selectionPolicy): a.minLatency.latency,
|
||||
"group": a.dialerGroupName,
|
||||
"network": string(a.l4proto) + string(a.ipversion),
|
||||
"new dialer": a.minLatency.dialer.Name(),
|
||||
"old dialer": bakOldBestDialer.Name(),
|
||||
"old dialer": oldDialerName,
|
||||
}).Infof("Group %vselects dialer", re)
|
||||
} else {
|
||||
// Alive -> not alive
|
||||
|
Loading…
Reference in New Issue
Block a user