Receive Stun bytes not counted
Ok, so this has bit us twice now, we don't see any recv bytes counted when we have no active streams. So figure it worth having an issue to track it.
There is no quick clean way to fix this, which is probably the reason it has a todo.
We switched to track the bytes outside str0m instead for now.
let bytes_rx = match r.contents.inner {
// TODO: stun is already parsed (depacketized) here
Stun(_) => 0,
Dtls(v) | Rtp(v) | Rtcp(v) => v.len(),
};
https://github.com/algesten/str0m/blob/783b020ff7c859372884889e205c5c838792e97a/src/lib.rs#L1824C9-L1828C11
Decision is to not count STUN in either direction.
/// Total bytes transmitted.
pub peer_bytes_rx: u64,
/// Total bytes received.
pub peer_bytes_tx: u64,
/// Total bytes transmitted, only counting media traffic (rtp payload).
pub bytes_rx: u64,
/// Total bytes received, only counting media traffic (rtp payload).
pub bytes_tx: u64,
@k0nserv @xnorpx hang on. Aren't we supposed to count STUN in peer_bytes_..?
Based on those comments it feels like peer_bytes_rx/tx should include stun as well. But yeah I am a little confused by the mapping.