Make Codec max frame length configurable (#57)

This commit is contained in:
Eliza Weisman
2017-09-11 14:56:40 -05:00
committed by Carl Lerche
parent 460afa41c8
commit 11de86b34e
3 changed files with 67 additions and 3 deletions

View File

@@ -219,6 +219,18 @@ impl<T> FramedRead<T> {
pub fn get_mut(&mut self) -> &mut T {
self.inner.get_mut()
}
/// Returns the current max frame size setting
#[inline]
pub fn max_frame_size(&self) -> usize {
self.inner.max_frame_length()
}
/// Updates the max frame size setting.
#[inline]
pub fn set_max_frame_size(&mut self, val: usize) {
self.inner.set_max_frame_length(val)
}
}
impl<T> Stream for FramedRead<T>