mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-11-18 18:36:11 -05:00
Fix: keep probeInterval consistent for the same outbound (#1230)
This commit is contained in:
parent
4f9415d001
commit
67cd3ac40e
@ -8,6 +8,7 @@ import (
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"sort"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
@ -68,6 +69,7 @@ func (o *Observer) background() {
|
||||
}
|
||||
|
||||
outbounds := hs.Select(o.config.SubjectSelector)
|
||||
sort.Strings(outbounds)
|
||||
|
||||
o.updateStatus(outbounds)
|
||||
|
||||
@ -111,7 +113,7 @@ func (o *Observer) probe(outbound string) ProbeResult {
|
||||
trackedCtx := session.TrackedConnectionError(o.ctx, errorCollectorForRequest)
|
||||
conn, err := tagged.Dialer(trackedCtx, dest, outbound)
|
||||
if err != nil {
|
||||
return newError("cannot dial remote address", dest).Base(err)
|
||||
return newError("cannot dial remote address ", dest).Base(err)
|
||||
}
|
||||
connection = conn
|
||||
return nil
|
||||
@ -158,7 +160,7 @@ func (o *Observer) probe(outbound string) ProbeResult {
|
||||
fullerr.WriteToLog()
|
||||
return ProbeResult{Alive: false, LastErrorReason: fullerr.Error()}
|
||||
}
|
||||
newError("the outbound ", outbound, "is alive:", GETTime.Seconds()).AtInfo().WriteToLog()
|
||||
newError("the outbound ", outbound, " is alive:", GETTime.Seconds()).AtInfo().WriteToLog()
|
||||
return ProbeResult{Alive: true, Delay: GETTime.Milliseconds()}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user