Publish Zonghengjia Windows 0.3.20 client source
This commit is contained in:
@@ -24,7 +24,7 @@ internal sealed class ConnectionHealthPolicy
|
||||
internal bool IsDue(long now, bool running) => !running || now >= _nextProbe;
|
||||
internal Decision Observe(long revision, int? testedCore, int? currentCore,
|
||||
bool wanted, bool busy, bool transitioning, bool exiting, bool healthy, long now, bool proxyHealthy = false,
|
||||
bool activeTailnet = false, bool businessUnavailable = false)
|
||||
bool activeTailnet = false, bool businessUnavailable = false, bool automaticSelection = false)
|
||||
{
|
||||
if (revision != Revision || testedCore != currentCore || !wanted || busy || transitioning || exiting)
|
||||
return Decision.Ignore;
|
||||
@@ -34,10 +34,18 @@ internal sealed class ConnectionHealthPolicy
|
||||
return Decision.Keep;
|
||||
}
|
||||
if (currentCore is not null && businessUnavailable && proxyHealthy) {
|
||||
Failures = 0; _nextProbe = now + 20_000;
|
||||
_nextProbe = now + 20_000;
|
||||
const Decision advisory = Decision.WebsiteUnavailable;
|
||||
var confirmed = _advisoryCandidate == advisory;
|
||||
_advisoryCandidate = advisory;
|
||||
if (automaticSelection) {
|
||||
// Both the ordinary route and the forced proxy business probe
|
||||
// failed. An automatically selected node gets two advisory
|
||||
// rounds, then must yield instead of remaining degraded forever.
|
||||
Failures = confirmed ? Failures + 1 : 1;
|
||||
if (Failures >= 3) return Decision.Switch;
|
||||
}
|
||||
else Failures = 0;
|
||||
return confirmed ? advisory : Decision.PendingAdvisory;
|
||||
}
|
||||
_advisoryCandidate = null;
|
||||
|
||||
Reference in New Issue
Block a user