Skip to content

Commit

Permalink
Temporary fix for fragmentation compatibility with Zenoh-Pico
Browse files Browse the repository at this point in the history
  • Loading branch information
Mallets committed Dec 18, 2023
1 parent 780ec60 commit 423aca4
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions io/zenoh-transport/src/common/batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,20 @@ impl BatchConfig {
}

pub fn max_buffer_size(&self) -> usize {
let mut len = self.mtu as usize;
if self.is_streamed {
len += BatchSize::BITS as usize / 8;
}
len
// @TODO: the value depends on wether the link is streamed or not
// In case it is streamed, we need to account also for the
// 2 bytes for the batch length. However, by doing so,
// fragmentation breaks with Zenoh-Pico since those 2 bytes
// are not accounted by it. Temporarily disabling this check
// till Zenoh-Pico is fixed.
// See: https://github.com/eclipse-zenoh/zenoh-pico/issues/291
//
// let mut len = self.mtu as usize;
// if self.is_streamed {
// len += BatchSize::BITS as usize / 8;
// }

self.mtu as usize
}
}

Expand Down

0 comments on commit 423aca4

Please sign in to comment.