mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-10-30 15:06:59 +00:00
Log network path only when changed
This commit is contained in:
@@ -20,6 +20,7 @@ type platformDefaultInterfaceMonitor struct {
|
|||||||
callbacks list.List[tun.DefaultInterfaceUpdateCallback]
|
callbacks list.List[tun.DefaultInterfaceUpdateCallback]
|
||||||
myInterfaces []string
|
myInterfaces []string
|
||||||
defaultInterfaceInitialized bool
|
defaultInterfaceInitialized bool
|
||||||
|
lastNetworkPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *platformDefaultInterfaceMonitor) Start() error {
|
func (m *platformDefaultInterfaceMonitor) Start() error {
|
||||||
@@ -57,7 +58,10 @@ func (m *platformDefaultInterfaceMonitor) UnregisterCallback(element *list.Eleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *platformDefaultInterfaceMonitor) UpdateNetworkPath(networkPath string) {
|
func (m *platformDefaultInterfaceMonitor) UpdateNetworkPath(networkPath string) {
|
||||||
m.logger.Debug("updated network path: ", networkPath)
|
if networkPath != m.lastNetworkPath {
|
||||||
|
m.lastNetworkPath = networkPath
|
||||||
|
m.logger.Debug("updated network path: ", networkPath)
|
||||||
|
}
|
||||||
if m.powerManager == nil {
|
if m.powerManager == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user