From 8e3ebfcc7b4f860b008332b27bb116866874f7b7 Mon Sep 17 00:00:00 2001 From: kixelated Date: Tue, 29 Aug 2023 15:30:21 -0700 Subject: [PATCH] Remove the incompatible role check. (#58) --- moq-transport/src/session.rs | 8 -------- moq-transport/src/setup/role.rs | 4 ---- 2 files changed, 12 deletions(-) diff --git a/moq-transport/src/session.rs b/moq-transport/src/session.rs index a5760e6..96e95ae 100644 --- a/moq-transport/src/session.rs +++ b/moq-transport/src/session.rs @@ -26,10 +26,6 @@ impl Session { .find(|version| **version == setup::Version::DRAFT_00) .context("no supported versions")?; - if !setup_client.role.compatible(role) { - anyhow::bail!("incompatible roles: {:?} {:?}", setup_client.role, role); - } - let setup_server = setup::Server { role, version: setup::Version::DRAFT_00, @@ -75,10 +71,6 @@ impl Session { anyhow::bail!("unsupported version: {:?}", setup_server.version); } - if !setup_server.role.compatible(role) { - anyhow::bail!("incompatible roles: {:?} {:?}", role, setup_server.role); - } - let send_control = message::Sender::new(send); let recv_control = message::Receiver::new(recv); diff --git a/moq-transport/src/setup/role.rs b/moq-transport/src/setup/role.rs index 47e3d21..c8d6222 100644 --- a/moq-transport/src/setup/role.rs +++ b/moq-transport/src/setup/role.rs @@ -23,10 +23,6 @@ impl Role { Self::Publisher => false, } } - - pub fn compatible(&self, other: Role) -> bool { - self.is_publisher() == other.is_subscriber() && self.is_subscriber() == other.is_publisher() - } } impl From for VarInt {