Publish Zonghengjia Windows 0.3.20 client source

This commit is contained in:
2026-11-28 00:26:12 +08:00
parent 54a3433b81
commit 308d71021e
26 changed files with 1643 additions and 968 deletions
+10 -2
View File
@@ -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;