resets too

This commit is contained in:
Oliver Gould
2017-07-17 08:18:38 +00:00
parent 76cb8e15fd
commit fb4f0bc5af
16 changed files with 296 additions and 91 deletions

View File

@@ -61,7 +61,25 @@ pub enum Frame<T = Bytes> {
PushPromise(PushPromise),
Settings(Settings),
Ping(Ping),
WindowUpdate(WindowUpdate)
WindowUpdate(WindowUpdate),
Reset(Reset)
}
impl<T> Frame<T> {
pub fn stream_id(&self) -> StreamId {
use self::Frame::*;
match self {
&Headers(ref v) => v.stream_id(),
&Data(ref v) => v.stream_id(),
&PushPromise(ref v) => v.stream_id(),
&WindowUpdate(ref v) => v.stream_id(),
&Reset(ref v) => v.stream_id(),
&Ping(_) |
&Settings(_) => StreamId::zero(),
}
}
}
/// Errors that can occur during parsing an HTTP/2 frame.