Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion quest/m2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ ranked just below deterministic TS legs, which it requires.
- [Browser media report](/quest/m2/rs2ts-browser-report.md) - compare Rust-backed and handwritten @moq/net through full media workloads, supplementing the pre-adoption comparisons
- [mTLS on tls://](/quest/m2/tls-listener-mtls.md) - a `tls://` listener can identify a cluster peer by its client certificate
- [Link quality](/quest/m2/link-quality.md) - a radio link's cost follows its measured quality without flapping routes
- [One transport adapter](/quest/m2/transport-adapter-dedup.md) - the poll transport adapter exists once, and the 64 KiB cap in moq-net's default `poll_read_buf` (not in the adapter) has a test
- [Archive recovery listing](/quest/m2/archive-recovery-listing.md) - a resumed DVR lists what changed since its checkpoint, not every stored group
- [IETF on the ring](/quest/m2/uring-ietf.md) - the io_uring workers serve moq-transport sessions too, so a uring relay drops no client protocol
- [One connection lifecycle](/quest/m2/uring-connection-log.md) - every accept path, io_uring included, logs a connection's span and close from one owner, so Interop's accounting works on the ring
Expand Down
29 changes: 0 additions & 29 deletions quest/m2/transport-adapter-dedup.md

This file was deleted.

38 changes: 38 additions & 0 deletions rs/moq-net/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,4 +712,42 @@ mod tests {
Poll::Ready(Ok(Some(0)))
));
}

#[test]
fn default_read_buf_caps_the_initialized_slice_on_ready_and_pending() {
struct ReadSpan(bool);
impl super::poll::RecvStream for ReadSpan {
type Error = crate::Error;
fn poll_read(&mut self, _: &mut Context<'_>, dst: &mut [u8]) -> Poll<Result<Option<usize>, Self::Error>> {
assert_eq!(
dst.len(),
64 * 1024,
"one poll must not initialize the whole spare capacity"
);
assert!(dst.iter().all(|byte| *byte == 0));
if self.0 {
return Poll::Pending;
}
dst.fill(7);
Poll::Ready(Ok(Some(dst.len())))
}
fn stop(&mut self, _: u32) {}
fn poll_closed(&mut self, _: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
Poll::Pending
}
}
for pending in [false, true] {
let mut buf = BytesMut::with_capacity(256 * 1024);
let mut cx = Context::from_waker(std::task::Waker::noop());
let result = ReadSpan(pending).poll_read_buf(&mut cx, &mut buf);
if pending {
assert!(result.is_pending());
assert!(buf.is_empty());
} else {
assert!(matches!(result, Poll::Ready(Ok(Some(65536)))));
assert_eq!(buf.len(), 64 * 1024);
assert!(buf.iter().all(|byte| *byte == 7));
}
}
}
}
Loading