fix inverted split for DATA frame padding (#330)

This commit is contained in:
Sean McArthur
2018-11-05 10:20:09 -08:00
committed by Carl Lerche
parent 1a8015da4a
commit e656c42353
5 changed files with 91 additions and 7 deletions

View File

@@ -63,6 +63,18 @@ impl<T> Data<T> {
}
}
/// Returns whther the `PADDED` flag is set on this frame.
#[cfg(feature = "unstable")]
pub fn is_padded(&self) -> bool {
self.flags.is_padded()
}
/// Sets the value for the `PADDED` flag on this frame.
#[cfg(feature = "unstable")]
pub fn set_padded(&mut self) {
self.flags.set_padded();
}
/// Returns a reference to this frame's payload.
///
/// This does **not** include any padding that might have been originally
@@ -192,6 +204,11 @@ impl DataFlags {
fn is_padded(&self) -> bool {
self.0 & PADDED == PADDED
}
#[cfg(feature = "unstable")]
fn set_padded(&mut self) {
self.0 |= PADDED
}
}
impl Default for DataFlags {