Skip to content

Commit

Permalink
Remove unused Ack message
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Feb 9, 2024
1 parent d3da646 commit ab57ab0
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 240 deletions.
129 changes: 0 additions & 129 deletions commons/zenoh-codec/src/zenoh/ack.rs

This file was deleted.

3 changes: 0 additions & 3 deletions commons/zenoh-codec/src/zenoh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
pub mod ack;
pub mod del;
pub mod err;
pub mod pull;
Expand Down Expand Up @@ -122,7 +121,6 @@ where
match x {
ResponseBody::Reply(b) => self.write(&mut *writer, b),
ResponseBody::Err(b) => self.write(&mut *writer, b),
ResponseBody::Ack(b) => self.write(&mut *writer, b),
ResponseBody::Put(b) => self.write(&mut *writer, b),
}
}
Expand All @@ -141,7 +139,6 @@ where
let body = match imsg::mid(codec.header) {
id::REPLY => ResponseBody::Reply(codec.read(&mut *reader)?),
id::ERR => ResponseBody::Err(codec.read(&mut *reader)?),
id::ACK => ResponseBody::Ack(codec.read(&mut *reader)?),
id::PUT => ResponseBody::Put(codec.read(&mut *reader)?),
_ => return Err(DidntRead),
};
Expand Down
5 changes: 0 additions & 5 deletions commons/zenoh-codec/tests/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,6 @@ fn codec_err() {
run!(zenoh::Err, zenoh::Err::rand());
}

#[test]
fn codec_ack() {
run!(zenoh::Ack, zenoh::Ack::rand());
}

#[test]
fn codec_pull() {
run!(zenoh::Pull, zenoh::Pull::rand());
Expand Down
84 changes: 0 additions & 84 deletions commons/zenoh-protocol/src/zenoh/ack.rs

This file was deleted.

17 changes: 3 additions & 14 deletions commons/zenoh-protocol/src/zenoh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// Contributors:
// ZettaScale Zenoh Team, <[email protected]>
//
pub mod ack;
pub mod del;
pub mod err;
pub mod pull;
Expand All @@ -20,7 +19,6 @@ pub mod query;
pub mod reply;

use crate::core::Encoding;
pub use ack::Ack;
pub use del::Del;
pub use err::Err;
pub use pull::Pull;
Expand All @@ -35,8 +33,7 @@ pub mod id {
pub const QUERY: u8 = 0x03;
pub const REPLY: u8 = 0x04;
pub const ERR: u8 = 0x05;
pub const ACK: u8 = 0x06;
pub const PULL: u8 = 0x07;
pub const PULL: u8 = 0x06;
}

// DataInfo
Expand Down Expand Up @@ -127,7 +124,6 @@ impl From<Del> for RequestBody {
pub enum ResponseBody {
Reply(Reply),
Err(Err),
Ack(Ack),
Put(Put),
}

Expand All @@ -138,11 +134,10 @@ impl ResponseBody {

let mut rng = rand::thread_rng();

match rng.gen_range(0..4) {
match rng.gen_range(0..3) {
0 => ResponseBody::Reply(Reply::rand()),
1 => ResponseBody::Err(Err::rand()),
2 => ResponseBody::Ack(Ack::rand()),
3 => ResponseBody::Put(Put::rand()),
2 => ResponseBody::Put(Put::rand()),
_ => unreachable!(),
}
}
Expand All @@ -160,12 +155,6 @@ impl From<Err> for ResponseBody {
}
}

impl From<Ack> for ResponseBody {
fn from(r: Ack) -> ResponseBody {
ResponseBody::Ack(r)
}
}

pub mod ext {
use zenoh_buffers::ZBuf;

Expand Down
5 changes: 0 additions & 5 deletions zenoh/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2247,11 +2247,6 @@ impl Primitives for Session {
fn send_response(&self, msg: Response) {
trace!("recv Response {:?}", msg);
match msg.payload {
ResponseBody::Ack(_) => {
log::warn!(
"Received a ResponseBody::Ack, but this isn't supported yet. Dropping message."
)
}
ResponseBody::Put(_) => {
log::warn!(
"Received a ResponseBody::Put, but this isn't supported yet. Dropping message."
Expand Down

0 comments on commit ab57ab0

Please sign in to comment.