Remove the incompatible role check. (#58)

This commit is contained in:
kixelated 2023-08-29 15:30:21 -07:00 committed by GitHub
parent fdc05ffb99
commit 8e3ebfcc7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 12 deletions

View File

@ -26,10 +26,6 @@ impl<S: WTSession> Session<S> {
.find(|version| **version == setup::Version::DRAFT_00) .find(|version| **version == setup::Version::DRAFT_00)
.context("no supported versions")?; .context("no supported versions")?;
if !setup_client.role.compatible(role) {
anyhow::bail!("incompatible roles: {:?} {:?}", setup_client.role, role);
}
let setup_server = setup::Server { let setup_server = setup::Server {
role, role,
version: setup::Version::DRAFT_00, version: setup::Version::DRAFT_00,
@ -75,10 +71,6 @@ impl<S: WTSession> Session<S> {
anyhow::bail!("unsupported version: {:?}", setup_server.version); 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 send_control = message::Sender::new(send);
let recv_control = message::Receiver::new(recv); let recv_control = message::Receiver::new(recv);

View File

@ -23,10 +23,6 @@ impl Role {
Self::Publisher => false, Self::Publisher => false,
} }
} }
pub fn compatible(&self, other: Role) -> bool {
self.is_publisher() == other.is_subscriber() && self.is_subscriber() == other.is_publisher()
}
} }
impl From<Role> for VarInt { impl From<Role> for VarInt {