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 @@ -94,7 +94,6 @@ lite-07; bitrate enforcement is not part of this release.
- [Rust-backed @moq/net](/quest/m2/rs2ts/README.md) - measure browser baselines, complete WASM bindings, and adopt Rust behind @moq/net before the later JS-only stage
- [Front parking](/quest/m2/origin-front-parks.md) - an unroutable request waits on a front instead of re-asking on every route-table move
- [Route wakes](/quest/m2/route-wakes.md) - a route change wakes only the fronts it can move, so pool churn stops scaling with served paths
- [Flatten nested Options](/quest/m2/nested-options.md) - three moq-net functions stop building `Option<Option<_>>`, so the TS translation reaches them
- [Fewer allocations in announce fan-out](/quest/m2/announce-fanout-allocs.md) - a deep path costs no more allocations per subscriber than a shallow one
- [Route health](/quest/m2/route-health/README.md) - epoch-only active/passive track recovery over metadata-only subscriptions
- [Wrapper traits over moq-net](/quest/m2/net-wrap/README.md) - moq-net exports producer and consumer traits, and every writer and reader above it takes them, so a wrapper such as e2ee passes through unchanged
Expand Down
17 changes: 0 additions & 17 deletions quest/m2/nested-options.md

This file was deleted.

3 changes: 2 additions & 1 deletion rs/moq-net/src/ietf/subscriber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5951,7 +5951,8 @@ fn resolve_fetch_group(prior: Option<u64>, wire: Option<u64>) -> Result<Option<u
return Ok(Some(wire));
};
let step = wire.checked_add(1).ok_or(Error::Unsupported)?;
prior.checked_add(step).map(Some).ok_or(Error::Unsupported)
let group = prior.checked_add(step).ok_or(Error::Unsupported)?;
Ok(Some(group))
}

fn open_fill_group(
Expand Down
3 changes: 2 additions & 1 deletion rs/moq-net/src/lite/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ impl Live {
return Ok(None);
}
let id = self.next.checked_sub(distance).ok_or(Error::ProtocolViolation)?;
self.entries.get(&id).map(Some).ok_or(Error::ProtocolViolation)
let entry = self.entries.get(&id).ok_or(Error::ProtocolViolation)?;
Ok(Some(entry))
}

fn resolve_path(&self, path: PathRef) -> Result<Path, Error> {
Expand Down
19 changes: 13 additions & 6 deletions rs/moq-net/src/model/track.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8187,9 +8187,8 @@ pub struct Request {
// unless this request was reserved on a tagged broadcast.
stats: stats::Scope,

// The floor the accepted track's start is pending at, until the source resolves it
// (see [`Self::request_start`]).
requested_start: Option<Option<u64>>,
// Where the accepted track's start is pending; see [`Self::request_start`].
requested_start: RequestedStart,

// Whether the accepted track starts idle; see [`Self::idle`].
idle: bool,
Expand All @@ -8201,6 +8200,14 @@ pub struct Request {
list: Option<broadcast::ListOnAccept>,
}

/// Whether a [`Request`] asked for its accepted track's start to be pending.
enum RequestedStart {
/// The track starts as [`Request::accept`] leaves it.
Unset,
/// Pending at this floor, `None` for the live edge, until the source resolves it.
Pending(Option<u64>),
}

impl Request {
pub(super) fn new(broadcast: Arc<broadcast::Info>, name: impl Into<Arc<str>>) -> Self {
let name = name.into();
Expand All @@ -8215,7 +8222,7 @@ impl Request {
alive,
_dynamic: dynamic,
stats: stats::Scope::default(),
requested_start: None,
requested_start: RequestedStart::Unset,
idle: false,
routes: None,
list: None,
Expand Down Expand Up @@ -8246,7 +8253,7 @@ impl Request {
/// see the track.
#[cfg_attr(not(feature = "async"), allow(dead_code, reason = "async-only"))]
pub(crate) fn request_start(mut self, floor: impl Into<Option<u64>>) -> Self {
self.requested_start = Some(floor.into());
self.requested_start = RequestedStart::Pending(floor.into());
self
}

Expand Down Expand Up @@ -8345,7 +8352,7 @@ impl Request {
Ok(mut state) => {
state.accept(info.clone());
state.staged = true;
if let Some(floor) = self.requested_start {
if let RequestedStart::Pending(floor) = self.requested_start {
state.set_start(floor, true);
}
if self.idle {
Expand Down