http2: support padded data frames

Ticket: #5691
(cherry picked from commit c6349d3cfc)
pull/8212/head
Philippe Antoine 3 years ago committed by Victor Julien
parent e9a0ac187c
commit 9cc92b8dd5

@ -832,6 +832,7 @@ impl HTTP2State {
let over = head.flags & parser::HTTP2_FLAG_HEADER_EOS != 0;
let ftype = head.ftype;
let sid = head.stream_id;
let padded = head.flags & parser::HTTP2_FLAG_HEADER_PADDED != 0;
if dir == STREAM_TOSERVER {
tx.frames_ts.push(HTTP2Frame {
header: head,
@ -851,8 +852,12 @@ impl HTTP2State {
if index > 0 {
let tx_same = &mut self.transactions[index - 1];
let (files, flags) = self.files.get(dir);
let mut dinput = &rem[..hlsafe];
if padded && rem.len() > 0 && usize::from(rem[0]) < hlsafe{
dinput = &rem[1..hlsafe - usize::from(rem[0])];
}
match tx_same.decompress(
&rem[..hlsafe],
dinput,
dir,
sfcm,
over,

@ -610,7 +610,7 @@ pub struct HTTP2FrameHeaders {
//end stream
pub const HTTP2_FLAG_HEADER_EOS: u8 = 0x1;
pub const HTTP2_FLAG_HEADER_END_HEADERS: u8 = 0x4;
const HTTP2_FLAG_HEADER_PADDED: u8 = 0x8;
pub const HTTP2_FLAG_HEADER_PADDED: u8 = 0x8;
const HTTP2_FLAG_HEADER_PRIORITY: u8 = 0x20;
pub fn http2_parse_frame_headers<'a>(

Loading…
Cancel
Save