From 1ed4610e36efb894a8c813b23044c0adb1a36bc6 Mon Sep 17 00:00:00 2001 From: Vsevolod Strukchinsky Date: Sun, 28 Jun 2026 23:36:26 +0500 Subject: [PATCH] moqt: tighten a few over-detailed/historical comments pkg/moqt/ comments are already in good shape (tight, spec-cited godoc with no stale filename or symbol references), so this is a small pass: - wire/varint.go: drop the "previously relied on from quicvarint.NewReader" history note from NewByteReader, stating the contract directly. - session/conn.go: condense the PrioritizedSendStream status paragraph. - session/request.go: remove a speculative "add a code-taking variant" parenthetical from resetStream. Co-Authored-By: Claude Opus 4.8 --- pkg/moqt/session/conn.go | 15 ++++++--------- pkg/moqt/session/request.go | 3 +-- pkg/moqt/wire/varint.go | 3 +-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/pkg/moqt/session/conn.go b/pkg/moqt/session/conn.go index ac4ab6f..afad8f5 100644 --- a/pkg/moqt/session/conn.go +++ b/pkg/moqt/session/conn.go @@ -98,15 +98,12 @@ func (p StreamPriority) Less(q StreamPriority) bool { // far as its transport allows. // // Callers SHOULD type-assert a [SendStream] to this interface and call -// SetSendPriority when available; adapters that don't satisfy the interface -// silently fall back to whatever scheduling the transport offers by -// default. None of the bundled adapters (quicconn, wtconn, sessiontest) -// currently implement this interface — quic-go does not expose a public -// per-stream priority API yet (tracked upstream at -// https://github.com/quic-go/quic-go/issues/437), and webtransport-go's -// HTTP/3 layer follows suit. The relay still pushes the full §7.2 priority -// through this interface so the day the transports add the knob, it lights up -// without further changes. +// SetSendPriority when available; adapters that don't satisfy it silently fall +// back to the transport's default scheduling. None of the bundled adapters +// (quicconn, wtconn, sessiontest) implement it yet — quic-go exposes no public +// per-stream priority API (quic-go#437) and webtransport-go follows suit — but +// the relay pushes the full §7.2 priority through anyway so it lights up once a +// transport adds the knob. type PrioritizedSendStream interface { // SetSendPriority sets the transport-level scheduling priority for // this stream. It is safe to call repeatedly during the stream's diff --git a/pkg/moqt/session/request.go b/pkg/moqt/session/request.go index 9a91161..ab451f5 100644 --- a/pkg/moqt/session/request.go +++ b/pkg/moqt/session/request.go @@ -183,8 +183,7 @@ func (s *Session) AcceptRequest(ctx context.Context) (*Request, error) { // resetStream resets both directions of a bidi request stream with // StreamResetInternalError (§3.3.3) — the common teardown when a request stream -// is abandoned mid-parse or fails §10.1 validation. (Add a code-taking variant -// if a future caller needs to reset with a different code.) +// is abandoned mid-parse or fails §10.1 validation. func resetStream(s Stream) { s.CancelRead(uint64(moqt.StreamResetInternalError)) s.CancelWrite(uint64(moqt.StreamResetInternalError)) diff --git a/pkg/moqt/wire/varint.go b/pkg/moqt/wire/varint.go index 281af14..16c4b50 100644 --- a/pkg/moqt/wire/varint.go +++ b/pkg/moqt/wire/varint.go @@ -141,8 +141,7 @@ func ReadVarint(r io.ByteReader) (uint64, error) { } // NewByteReader adapts an io.Reader to io.ByteReader by reading a single byte -// per call, with no buffering or look-ahead. It mirrors the contract callers -// previously relied on from quicvarint.NewReader, so a varint read leaves the +// per call, with no buffering or look-ahead, so a varint read leaves the // underlying reader positioned exactly after the varint. func NewByteReader(r io.Reader) io.ByteReader { if br, ok := r.(io.ByteReader); ok {