docs(stats): clarify server receive-window semantics

An audit of the server-reported receive window found no defect in the
statistics pipeline: the bitmap is decoded raw, stored raw, never
interpreted, and never feeds the directional loss estimates, which use
the cumulative server receive count.

The public rustdoc was silent on all of that, leaving consumers of
PacketCounts free to read a window of 0x1 as a 63-packet loss burst.
Document the field's contract, name the count as the only server input
to LossStats, and cover the window-only case with a regression test.
This commit is contained in:
Nils Andreas Svee committed 2026-08-11 23:21:58 +07:00
1 parent d5c3e21a05
commit 0977db1fe2
5 files changed
+67 -3

No files matched your search

+4 -1
View File
@@ -361,7 +361,10 @@ pub struct OneWayDelaySample {
pub struct ReceivedStatsSample {
/// Server-reported count of received packets, when available.
pub count: Option<u32>,
/// Server-reported receive window value, when available.
/// Raw server-reported receive window bitmap, when available.
///
/// The bitmap is preserved exactly as it appeared on the wire; the client
/// does not interpret its bits.
pub window: Option<u64>,
}