From f0d2f115254ce25e79abc0280fcd80033f1f0097 Mon Sep 17 00:00:00 2001 From: Alessandro Ros Date: Wed, 5 Aug 2026 11:33:39 +0200 Subject: [PATCH] moq: link primitives to draft-17 sections (#6044) --- internal/protocols/moq/controlmessage/publish.go | 4 +++- internal/protocols/moq/controlmessage/publish_ok.go | 5 +++-- .../protocols/moq/controlmessage/request_error.go | 9 +++++++-- internal/protocols/moq/controlmessage/request_ok.go | 4 +++- internal/protocols/moq/controlmessage/setup.go | 4 +++- internal/protocols/moq/controlmessage/subscribe.go | 4 +++- .../protocols/moq/controlmessage/subscribe_ok.go | 4 +++- internal/protocols/moq/namespace/namespace.go | 4 ++-- .../protocols/moq/parameter/authorization_token.go | 12 +++++++++--- internal/protocols/moq/parameter/parameter.go | 4 +++- internal/protocols/moq/property/property.go | 8 ++++++-- internal/protocols/moq/subgroup/header.go | 4 +++- internal/protocols/moq/subgroup/object.go | 4 +++- internal/protocols/moq/varint/varint.go | 2 +- 14 files changed, 52 insertions(+), 20 deletions(-) diff --git a/internal/protocols/moq/controlmessage/publish.go b/internal/protocols/moq/controlmessage/publish.go index e1e66f92..22893ebf 100644 --- a/internal/protocols/moq/controlmessage/publish.go +++ b/internal/protocols/moq/controlmessage/publish.go @@ -12,7 +12,9 @@ import ( const typePublish varint.Varint = 0x1d // Publish is the PUBLISH control message. -// spec: draft-18/19, section 10.10 +// spec: +// * draft-17, section 9.11 +// * draft-18/19, section 10.10 type Publish struct { RequestID uint64 Namespace namespace.Namespace diff --git a/internal/protocols/moq/controlmessage/publish_ok.go b/internal/protocols/moq/controlmessage/publish_ok.go index 44287dd5..6171643b 100644 --- a/internal/protocols/moq/controlmessage/publish_ok.go +++ b/internal/protocols/moq/controlmessage/publish_ok.go @@ -9,8 +9,9 @@ import ( const typePublishOk varint.Varint = 0x1E // PublishOk is the PUBLISH_OK control message. -// spec: draft-17, section 9.12 -// spec: draft-18/19, section 10.5 (alias of REQUEST_OK) +// spec: +// * draft-17, section 9.12 +// * draft-18/19, section 10.5 (alias of REQUEST_OK) type PublishOk struct { Parameters parameter.Parameters TrackProperties property.Properties diff --git a/internal/protocols/moq/controlmessage/request_error.go b/internal/protocols/moq/controlmessage/request_error.go index 968c5089..36da74bf 100644 --- a/internal/protocols/moq/controlmessage/request_error.go +++ b/internal/protocols/moq/controlmessage/request_error.go @@ -11,7 +11,10 @@ const typeRequestError varint.Varint = 0x05 // RequestErrorCode is a code of REQUEST_ERROR. type RequestErrorCode uint64 -// spec: draft-18, section 15.10.2 / draft-19, section 15.11.2 +// spec: +// * draft-17, section 14.5.2 +// * draft-18, section 15.10.2 +// * draft-19, section 15.11.2 const ( RequestErrorCodeUnauthorized RequestErrorCode = 0x01 RequestErrorCodeNotSupported RequestErrorCode = 0x03 @@ -20,7 +23,9 @@ const ( ) // RequestError is the REQUEST_ERROR control message. -// spec: draft-18/19, section 10.6.2 +// spec: +// * draft-17, section 9.7 +// * draft-18/19, section 10.6.2 type RequestError struct { Code RequestErrorCode Reason string diff --git a/internal/protocols/moq/controlmessage/request_ok.go b/internal/protocols/moq/controlmessage/request_ok.go index 24c6c352..9c867b4e 100644 --- a/internal/protocols/moq/controlmessage/request_ok.go +++ b/internal/protocols/moq/controlmessage/request_ok.go @@ -9,7 +9,9 @@ import ( const typeRequestOk varint.Varint = 0x07 // RequestOk is the REQUEST_OK control message. -// spec: draft-18/19, section 10.5 +// spec: +// * draft-17, section 9.6 +// * draft-18/19, section 10.5 type RequestOk struct { Parameters parameter.Parameters TrackProperties property.Properties diff --git a/internal/protocols/moq/controlmessage/setup.go b/internal/protocols/moq/controlmessage/setup.go index 9c659ef1..dc33a95a 100644 --- a/internal/protocols/moq/controlmessage/setup.go +++ b/internal/protocols/moq/controlmessage/setup.go @@ -14,7 +14,9 @@ const ( ) // Setup is the SETUP control message. -// spec: draft-18/19, section 10.3 +// spec: +// * draft-17, section 9.4 +// * draft-18/19, section 10.3 type Setup struct { Path string Authority string diff --git a/internal/protocols/moq/controlmessage/subscribe.go b/internal/protocols/moq/controlmessage/subscribe.go index 6e3eb576..628f2ffc 100644 --- a/internal/protocols/moq/controlmessage/subscribe.go +++ b/internal/protocols/moq/controlmessage/subscribe.go @@ -11,7 +11,9 @@ import ( const typeSubscribe varint.Varint = 0x03 // Subscribe is the SUBSCRIBE control message. -// spec: draft-18/19, section 10.7 +// spec: +// * draft-17, section 9.8 +// * draft-18/19, section 10.7 type Subscribe struct { RequestID uint64 Namespace namespace.Namespace diff --git a/internal/protocols/moq/controlmessage/subscribe_ok.go b/internal/protocols/moq/controlmessage/subscribe_ok.go index a759f5a3..59412ae1 100644 --- a/internal/protocols/moq/controlmessage/subscribe_ok.go +++ b/internal/protocols/moq/controlmessage/subscribe_ok.go @@ -9,7 +9,9 @@ import ( const typeSubscribeOk varint.Varint = 0x04 // SubscribeOk is the SUBSCRIBE_OK control message. -// spec: draft-18/19, section 10.8 +// spec: +// * draft-17, section 9.9 +// * draft-18/19, section 10.8 type SubscribeOk struct { TrackAlias uint64 Parameters parameter.Parameters diff --git a/internal/protocols/moq/namespace/namespace.go b/internal/protocols/moq/namespace/namespace.go index ceb26be5..b1d3a361 100644 --- a/internal/protocols/moq/namespace/namespace.go +++ b/internal/protocols/moq/namespace/namespace.go @@ -8,12 +8,12 @@ import ( ) const ( - // spec: draft-18/19, section 2.4.1 + // spec: draft-17/18/19, section 2.4.1 maxFieldCount = 32 ) // Namespace is a MOQ track namespace. -// spec: draft-18/19, section 2.4.1 +// spec: draft-17/18/19, section 2.4.1 type Namespace []string // Unmarshal deserializes a namespace from a buffer. diff --git a/internal/protocols/moq/parameter/authorization_token.go b/internal/protocols/moq/parameter/authorization_token.go index dc7fe868..232ccc33 100644 --- a/internal/protocols/moq/parameter/authorization_token.go +++ b/internal/protocols/moq/parameter/authorization_token.go @@ -9,16 +9,22 @@ import ( const typeAuthorizationToken = 0x03 // AuthorizationTokenAliasType is a value of Alias Type. -// spec: draft-18/19, section 10.2.2 +// spec: +// * draft-17, section 9.3.2 +// * draft-18/19, section 10.2.2 type AuthorizationTokenAliasType uint64 -// spec: draft-18/19, section 10.2.2 +// spec: +// * draft-17, section 9.3.2 +// * draft-18/19, section 10.2.2 const ( AuthorizationTokenAliasTypeUseValue AuthorizationTokenAliasType = 0x03 ) // AuthorizationToken is the AUTHORIZATION_TOKEN parameter. -// spec: draft-18/19, section 10.2.2 +// spec: +// * draft-17, section 9.3.2 +// * draft-18/19, section 10.2.2 type AuthorizationToken struct { AliasType AuthorizationTokenAliasType TokenType uint64 diff --git a/internal/protocols/moq/parameter/parameter.go b/internal/protocols/moq/parameter/parameter.go index a2c0fde4..b4762e26 100644 --- a/internal/protocols/moq/parameter/parameter.go +++ b/internal/protocols/moq/parameter/parameter.go @@ -8,7 +8,9 @@ import ( ) // Parameter is a parameter of a control message. -// spec: draft-18/19, section 10.2 +// spec: +// * draft-17, section 9.3 +// * draft-18/19, section 10.2 type Parameter interface { isParameter() paramType() uint64 diff --git a/internal/protocols/moq/property/property.go b/internal/protocols/moq/property/property.go index 3c621e29..4fc42cc6 100644 --- a/internal/protocols/moq/property/property.go +++ b/internal/protocols/moq/property/property.go @@ -8,7 +8,9 @@ import ( ) // Property is an object property. -// spec: draft-18/19, section 11.2.1.2 +// spec: +// * draft-17, section 10.2.1.2 +// * draft-18/19, section 11.2.1.2 type Property interface { isProperty() propType() varint.Varint @@ -18,7 +20,9 @@ type Property interface { } // Properties are object properties. -// spec: draft-18/19, section 11.2.1.2 +// spec: +// * draft-17, section 10.2.1.2 +// * draft-18/19, section 11.2.1.2 type Properties []Property // Unmarshal decodes properties. diff --git a/internal/protocols/moq/subgroup/header.go b/internal/protocols/moq/subgroup/header.go index 7579242a..a5b8acc2 100644 --- a/internal/protocols/moq/subgroup/header.go +++ b/internal/protocols/moq/subgroup/header.go @@ -8,7 +8,9 @@ import ( ) // Header is the SUBGROUP_HEADER structure. -// spec: draft-18/19, section 11.4.2 +// spec: +// * draft-17, section 10.4.2 +// * draft-18/19, section 11.4.2 type Header struct { Properties bool FirstObject bool diff --git a/internal/protocols/moq/subgroup/object.go b/internal/protocols/moq/subgroup/object.go index 654d925d..1c6d5f61 100644 --- a/internal/protocols/moq/subgroup/object.go +++ b/internal/protocols/moq/subgroup/object.go @@ -14,7 +14,9 @@ const ( ) // Object is an object of a subgroup stream. -// spec: draft-18/19, section 11.4.2 +// spec: +// * draft-17, section 10.4.2 +// * draft-18/19, section 11.4.2 type Object struct { IDDelta uint64 Properties property.Properties diff --git a/internal/protocols/moq/varint/varint.go b/internal/protocols/moq/varint/varint.go index 94c9d4dd..545bd9fa 100644 --- a/internal/protocols/moq/varint/varint.go +++ b/internal/protocols/moq/varint/varint.go @@ -7,7 +7,7 @@ import ( ) // Varint is a variable-length integer. -// spec: draft-18/19, section 1.4.1 +// spec: draft-17/18/19, section 1.4.1 type Varint uint64 // Read reads a Varint from a Reader.