Skip to content

Commit

Permalink
Fix shared-memory feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Feb 7, 2024
1 parent c8df037 commit 94de239
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
17 changes: 9 additions & 8 deletions io/zenoh-transport/src/shm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use zenoh_protocol::{
err::{ext::ErrBodyType, Err},
ext::ShmType,
query::{ext::QueryBodyType, Query},
reply::ReplyBody,
PushBody, Put, Reply, RequestBody, ResponseBody,
},
};
Expand Down Expand Up @@ -105,17 +106,17 @@ impl MapShm for Query {
// Impl - Reply
impl MapShm for Reply {
fn map_to_shminfo(&mut self) -> ZResult<bool> {
let Self {
payload, ext_shm, ..
} = self;
map_to_shminfo!(payload, ext_shm)
match &mut self.payload {
ReplyBody::Put(b) => b.map_to_shminfo(),
_ => Ok(false),
}
}

fn map_to_shmbuf(&mut self, shmr: &RwLock<SharedMemoryReader>) -> ZResult<bool> {
let Self {
payload, ext_shm, ..
} = self;
map_to_shmbuf!(payload, ext_shm, shmr)
match &mut self.payload {
ReplyBody::Put(b) => b.map_to_shmbuf(shmr),
_ => Ok(false),
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion zenoh/src/net/routing/dispatcher/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,9 @@ pub fn route_query(
encoding: Encoding::default(), // @TODO: handle encoding
ext_sinfo: None, // @TODO: handle source info
ext_attachment: None, // @TODO: expose it in the API
ext_unknown: vec![], // @TODO: handle unknown extensions
#[cfg(feature = "shared-memory")]
ext_shm: None,
ext_unknown: vec![], // @TODO: handle unknown extensions
payload,
}),
});
Expand Down

0 comments on commit 94de239

Please sign in to comment.