Validate & convert messages before buffering

Malformed requests and responses should immediately result in a
RST_STREAM. To support this, received header frames are validated and
converted to Request / Response values immediately on receipt and before
buffering.
This commit is contained in:
Carl Lerche
2017-08-30 18:00:32 -04:00
parent 9bb34d907a
commit 2452cc4423
10 changed files with 246 additions and 157 deletions

View File

@@ -73,16 +73,6 @@ pub enum Frame<T = Bytes> {
}
impl<T> Frame<T> {
/// Returns true if the frame is a DATA frame.
pub fn is_data(&self) -> bool {
use self::Frame::*;
match *self {
Data(..) => true,
_ => false,
}
}
pub fn map<F, U>(self, f: F) -> Frame<U>
where F: FnOnce(T) -> U
{