fn prefixes_overlap(a: &[Vec<u8>], b: &[Vec<u8>]) -> boolExpand description
Whether two namespace prefixes overlap.
Section 10.19: “Within a session, if a publisher receives a SUBSCRIBE_NAMESPACE with a Track Namespace Prefix that shares a common prefix with an established SUBSCRIBE_NAMESPACE, it MUST respond with REQUEST_ERROR with error code PREFIX_OVERLAP.”
Section 10.20: “Within a session, if a publisher receives a SUBSCRIBE_TRACKS with a Track Namespace Prefix that shares a common prefix with an established SUBSCRIBE_TRACKS, it MUST respond with REQUEST_ERROR with error code PREFIX_OVERLAP.”
Section 10.6.2: “SUBSCRIBE_NAMESPACE and SUBSCRIBE_TRACKS have independent overlap spaces, so a SUBSCRIBE_NAMESPACE and a SUBSCRIBE_TRACKS may share the same prefix.”
A namespace matches a namespace subscription when the subscription’s prefix is a prefix of it, so two prefixes select overlapping sets of namespaces exactly when one of them is a prefix of the other. Equal prefixes are that case as well: every prefix is a prefix of itself, and two equal ones select the same set.
“Shares a common prefix with” is read as the relation drafts 07 through 14 spell out at greater length. Taken at its word it would forbid every second namespace subscription in a session, since any two prefixes share the empty one, and nothing else in this draft supports that.