Confirm peer data paths and fit the Devices window to its roster
Measure the encrypted round trip to each reachable peer using the existing overlay echo, including over mesh relays. Keep the last sample during a new probe or one missed reply. Clear it when the route or addresses are lost or two probes time out. Exclude these packets from application counters and idle activity. Ready and Idle require a confirmed path and a usable key. Require a verified data path before a speed test can send, and let a responder finish its first echo if the initiator is ready first. Keep the payload on the encrypted tunnel and reserve time for reliable feedback within the five-second deadline. Native TCP TLS now prefers 9442, advertises the actual bound port and honors explicit overrides. Existing wire versions remain compatible. Extend the network and peer traffic plots to the right edge. Set the initial Devices height from the roster and row spacing, bounded by the monitor and a 260–780 point range. Subsequent snapshots preserve manual resizing. Validated on macOS arm64 with workspace formatting, strict Clippy and the locked all-targets suite (692 passed, 8 ignored by default). Also ran the opt-in 120-second WireGuard rekey test. Coverage includes a real three-agent relayed speed test, control-only rejection, delayed control feedback and resized egui frames. Cargo emitted a manifest warning about the existing directories dependency.
This commit is contained in:
1 parent
a966152143
commit
87fa83e482
27 files changed
+772
-299
No files matched your search
@@ -192,6 +192,7 @@ impl Session {
|
||||
if self.cfg.mtu < MIN_MTU || self.cfg.byte_limit == 0 || self.cfg.local == self.cfg.remote {
|
||||
return Err(State::Failed);
|
||||
}
|
||||
let negotiation_started = Instant::now();
|
||||
if let Some(start) = self.request {
|
||||
if !Control::Start(start).valid() {
|
||||
return Err(State::Failed);
|
||||
@@ -232,6 +233,7 @@ impl Session {
|
||||
}
|
||||
}
|
||||
|
||||
let negotiation_time = negotiation_started.elapsed();
|
||||
for direction in [Direction::Download, Direction::Upload] {
|
||||
self.progress.state = match direction {
|
||||
Direction::Download => State::Download,
|
||||
@@ -240,7 +242,8 @@ impl Session {
|
||||
io.progress(self.progress);
|
||||
let sender = (direction == Direction::Download) == self.request.is_some();
|
||||
let result = if sender {
|
||||
self.send_probes(io, direction, deadline).await?
|
||||
self.send_probes(io, direction, deadline, negotiation_time)
|
||||
.await?
|
||||
} else {
|
||||
self.receive_probes(io, direction).await?
|
||||
};
|
||||
@@ -255,7 +258,9 @@ impl Session {
|
||||
io: &impl Io,
|
||||
direction: Direction,
|
||||
deadline: Instant,
|
||||
negotiation_time: Duration,
|
||||
) -> Result<Reading, State> {
|
||||
let waiting = Instant::now();
|
||||
loop {
|
||||
if matches!(open_control(self.events.recv().await)?, Control::Ready { direction: d, .. } if d == direction)
|
||||
{
|
||||
@@ -263,10 +268,17 @@ impl Session {
|
||||
}
|
||||
}
|
||||
let start = Instant::now();
|
||||
// Leave room for the opposite direction and the final reliable report.
|
||||
// End and Report travel on reliable control. Leave room for their
|
||||
// exchange and a queued feedback message even on a slow control path.
|
||||
// Only the receiver's data packets contribute to the measured rate.
|
||||
let report_time = negotiation_time
|
||||
.max(waiting.elapsed())
|
||||
.saturating_mul(3)
|
||||
.saturating_add(Duration::from_millis(200))
|
||||
.min(Duration::from_millis(1600));
|
||||
let remaining = deadline
|
||||
.saturating_duration_since(start)
|
||||
.saturating_sub(Duration::from_millis(200));
|
||||
.saturating_sub(report_time);
|
||||
let phase = if direction == Direction::Download {
|
||||
remaining / 2
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user