Publish Zonghengjia Windows 0.3.13 client source

This commit is contained in:
2026-11-13 10:35:04 +08:00
parent 1590443809
commit 839434a313
55 changed files with 2324 additions and 963 deletions
+13 -3
View File
@@ -4,12 +4,17 @@ namespace UCVL.VPNPlus;
// A delayed probe must not undo a user's disconnect or judge a different core.
internal sealed class ConnectionHealthPolicy
{
internal enum Decision { Ignore, Keep, Repair, Degraded, Switch }
internal enum Decision { Ignore, Keep, Repair, PendingAdvisory, WebsiteUnavailable, TailnetEgressUnverified, Switch }
internal long Revision { get; private set; }
internal int Failures { get; private set; }
internal bool HasBeenHealthy { get; private set; }
private long _nextProbe;
internal void Invalidate() => Revision++;
private Decision? _advisoryCandidate;
internal void Invalidate()
{
Revision++;
_advisoryCandidate = null;
}
internal void BeginCore(long now)
{
Invalidate(); Failures = 0; HasBeenHealthy = false;
@@ -24,6 +29,7 @@ internal sealed class ConnectionHealthPolicy
if (revision != Revision || testedCore != currentCore || !wanted || busy || transitioning || exiting)
return Decision.Ignore;
if (healthy && currentCore is not null) {
_advisoryCandidate = null;
HasBeenHealthy = true; Failures = 0; _nextProbe = now + 20_000;
return Decision.Keep;
}
@@ -31,8 +37,12 @@ internal sealed class ConnectionHealthPolicy
// Third-party HTTP diagnostics cannot identify an active Tailnet
// transport failure. The bounded periodic ICMP policy owns fallback.
Failures = 0; _nextProbe = now + 20_000;
return Decision.Degraded;
var advisory = proxyHealthy ? Decision.WebsiteUnavailable : Decision.TailnetEgressUnverified;
var confirmed = _advisoryCandidate == advisory;
_advisoryCandidate = advisory;
return confirmed ? advisory : Decision.PendingAdvisory;
}
_advisoryCandidate = null;
if (proxyHealthy && currentCore is not null) {
// Do not punish/restart a working node for a local smart-rule fault.
// The UI must show degraded routing, not declare the business path healthy.