Skip to content

Commit 77d5c7c

Browse files
catenacybervictorjulien
authored andcommitted
http2: fix parsing of goaway frames
There was a last stream id before the error code As per section 6.8 of RFC 7540 Ticket: 7991 (cherry picked from commit 9a4a29e)
1 parent 3e071d7 commit 77d5c7c

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

rust/src/http2/http2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub enum HTTP2ConnectionState {
6969

7070
const HTTP2_FRAME_HEADER_LEN: usize = 9;
7171
const HTTP2_MAGIC_LEN: usize = 24;
72-
const HTTP2_FRAME_GOAWAY_LEN: usize = 4;
72+
const HTTP2_FRAME_GOAWAY_LEN: usize = 8;
7373
const HTTP2_FRAME_RSTSTREAM_LEN: usize = 4;
7474
const HTTP2_FRAME_PRIORITY_LEN: usize = 5;
7575
const HTTP2_FRAME_WINDOWUPDATE_LEN: usize = 4;

rust/src/http2/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ pub struct HTTP2FrameGoAway {
161161
}
162162

163163
pub fn http2_parse_frame_goaway(i: &[u8]) -> IResult<&[u8], HTTP2FrameGoAway> {
164+
let (i, _last_stream_id) = be_u32(i)?;
164165
let (i, errorcode) = be_u32(i)?;
165166
Ok((i, HTTP2FrameGoAway { errorcode }))
166167
}

0 commit comments

Comments
 (0)