Stub out window update
This commit is contained in:
@@ -34,6 +34,7 @@ mod reset;
|
|||||||
mod settings;
|
mod settings;
|
||||||
mod stream_id;
|
mod stream_id;
|
||||||
mod util;
|
mod util;
|
||||||
|
mod window_update;
|
||||||
|
|
||||||
pub use self::data::Data;
|
pub use self::data::Data;
|
||||||
pub use self::go_away::GoAway;
|
pub use self::go_away::GoAway;
|
||||||
@@ -43,6 +44,7 @@ pub use self::ping::Ping;
|
|||||||
pub use self::reset::Reset;
|
pub use self::reset::Reset;
|
||||||
pub use self::settings::{Settings, SettingSet};
|
pub use self::settings::{Settings, SettingSet};
|
||||||
pub use self::stream_id::StreamId;
|
pub use self::stream_id::StreamId;
|
||||||
|
pub use self::window_update::WindowUpdate;
|
||||||
|
|
||||||
// Re-export some constants
|
// Re-export some constants
|
||||||
pub use self::settings::{
|
pub use self::settings::{
|
||||||
|
|||||||
28
src/frame/window_update.rs
Normal file
28
src/frame/window_update.rs
Normal 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,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -91,7 +91,12 @@ impl<T> FramedRead<T> {
|
|||||||
debug!("decoded; frame={:?}", frame);
|
debug!("decoded; frame={:?}", frame);
|
||||||
unimplemented!();
|
unimplemented!();
|
||||||
}
|
}
|
||||||
Kind::WindowUpdate => unimplemented!(),
|
Kind::WindowUpdate => {
|
||||||
|
// TODO: IMPLEMENT
|
||||||
|
let frame = try!(frame::WindowUpdate::load(head, &bytes[frame::HEADER_LEN..]));
|
||||||
|
debug!("decoded; frame={:?}", frame);
|
||||||
|
return Ok(None);
|
||||||
|
},
|
||||||
Kind::Continuation => {
|
Kind::Continuation => {
|
||||||
unimplemented!();
|
unimplemented!();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user