Get a request sent

This commit is contained in:
Carl Lerche
2017-06-26 22:25:25 -07:00
parent ac2959e956
commit 7897b770e9
15 changed files with 296 additions and 125 deletions

26
src/frame/go_away.rs Normal file
View File

@@ -0,0 +1,26 @@
use frame::Error;
use super::{head, StreamId};
#[derive(Debug)]
pub struct GoAway {
last_stream_id: StreamId,
error_code: u32,
}
impl GoAway {
pub fn load(payload: &[u8]) -> Result<GoAway, Error> {
if payload.len() < 8 {
// Invalid payload len
// TODO: Handle error
unimplemented!();
}
let last_stream_id = head::parse_stream_id(&payload[..4]);
let error_code = unpack_octets_4!(payload, 4, u32);
Ok(GoAway {
last_stream_id: last_stream_id,
error_code: error_code,
})
}
}