Remove the incompatible role check. (#58)
This commit is contained in:
parent
fdc05ffb99
commit
8e3ebfcc7b
|
@ -26,10 +26,6 @@ impl<S: WTSession> Session<S> {
|
|||
.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<S: WTSession> Session<S> {
|
|||
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);
|
||||
|
||||
|
|
|
@ -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<Role> for VarInt {
|
||||
|
|
Loading…
Reference in New Issue