Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary fix for fragmentation compatibility with Zenoh-Pico #630

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading