Stub out window update

This commit is contained in:
Carl Lerche
2017-07-08 22:36:24 -07:00
parent 981af88838
commit 6d1d54f104
3 changed files with 36 additions and 1 deletions

View File

@@ -0,0 +1,28 @@
use frame::{Head, Error};
use super::{StreamId};
#[derive(Debug)]
pub struct WindowUpdate {
stream_id: StreamId,
size_increment: u32,
}
const SIZE_INCREMENT_MASK: u32 = 1 << 31;
impl WindowUpdate {
pub fn load(head: Head, payload: &[u8]) -> Result<WindowUpdate, Error> {
if payload.len() != 4 {
// Invalid payload len
// TODO: Handle error
unimplemented!();
}
let size_increment = unpack_octets_4!(payload, 0, u32)
& !SIZE_INCREMENT_MASK;
Ok(WindowUpdate {
stream_id: head.stream_id(),
size_increment: size_increment,
})
}
}