Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Feb 16, 2024
1 parent 346654e commit d761a1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions outbound/wireguard.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,27 +240,29 @@ func (w *WireGuard) Close() error {
}

func (w *WireGuard) InterfaceUpdated() {
w.logger.Warn("Hiddify! Wirguard! Interface updated!1")
for _, wgout := range w.wgDependencies {
wgout.InterfaceUpdated()
}
if time.Since(w.lastUpdate) < 50*time.Millisecond {
return
}
w.lastUpdate = time.Now()
w.logger.Warn("Hiddify! Wirguard! Interface updated!")
w.logger.Warn("Hiddify! Wirguard! Interface updated!2")
w.device.BindUpdate()
return
}

func (w *WireGuard) onPauseUpdated(event int) {
w.logger.Warn("Hiddify! Wirguard! on Pause updated!1")
for _, wgout := range w.wgDependencies {
wgout.onPauseUpdated(event)
}
if time.Since(w.lastUpdate) < 50*time.Millisecond {
return
}
w.lastUpdate = time.Now()
w.logger.Warn("Hiddify! Wirguard! on Pause updated!")
w.logger.Warn("Hiddify! Wirguard! on Pause updated!2")
switch event {
case pause.EventDevicePaused:
w.device.Down()
Expand Down
3 changes: 3 additions & 0 deletions route/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -1051,6 +1051,7 @@ func (r *Router) InterfaceFinder() control.InterfaceFinder {
}

func (r *Router) UpdateInterfaces() error {
r.logger.Warn("Hiddify!UpdateInterfaces ")
if r.platformInterface == nil || !r.platformInterface.UsePlatformInterfaceGetter() {
return r.interfaceFinder.update()
} else {
Expand Down Expand Up @@ -1153,6 +1154,7 @@ func (r *Router) NewError(ctx context.Context, err error) {
}

func (r *Router) notifyNetworkUpdate(event int) {
r.logger.Warn("Hiddify!notifyNetworkUpdate ", event)
if event == tun.EventNoRoute {
r.pauseManager.NetworkPause()
r.logger.Error("missing default interface")
Expand All @@ -1179,6 +1181,7 @@ func (r *Router) notifyNetworkUpdate(event int) {
}

func (r *Router) ResetNetwork() error {
r.logger.Warn("Hiddify!Reseting Network")
conntrack.Close()

for _, outbound := range r.outbounds {
Expand Down

0 comments on commit d761a1b

Please sign in to comment.