Fix URLTest outbound

This commit is contained in:
世界
2023-12-02 17:47:57 +08:00
parent fc8e49994c
commit 5269231df0
6 changed files with 53 additions and 58 deletions

View File

@@ -88,6 +88,7 @@ type Router struct {
platformInterface platform.Interface
needWIFIState bool
wifiState adapter.WIFIState
started bool
}
func NewRouter(
@@ -571,6 +572,11 @@ func (r *Router) Close() error {
return err
}
func (r *Router) PostStart() error {
r.started = true
return nil
}
func (r *Router) Outbound(tag string) (adapter.Outbound, bool) {
outbound, loaded := r.outboundByTag[tag]
return outbound, loaded
@@ -1015,8 +1021,11 @@ func (r *Router) notifyNetworkUpdate(event int) {
}
}
r.ResetNetwork()
return
if !r.started {
return
}
_ = r.ResetNetwork()
}
func (r *Router) ResetNetwork() error {