match &tx.frames_ts[i].data {
HTTP2FrameTypeData::HEADERS(hd) => {
if nb < pos + hd.blocks.len() as u32 {
- tx.escaped_tmp = http2_escape_header(&hd, nb - pos);
- let value = &tx.escaped_tmp;
+ let ehdr = http2_escape_header(&hd, nb - pos);
+ tx.escaped.push(ehdr);
+ let idx = tx.escaped.len() - 1;
+ let value = &tx.escaped[idx];
*buffer = value.as_ptr(); //unsafe
*buffer_len = value.len() as u32;
return 1;
match &tx.frames_tc[i].data {
HTTP2FrameTypeData::HEADERS(hd) => {
if nb < pos + hd.blocks.len() as u32 {
- tx.escaped_tmp = http2_escape_header(&hd, nb - pos);
- let value = &tx.escaped_tmp;
+ let ehdr = http2_escape_header(&hd, nb - pos);
+ tx.escaped.push(ehdr);
+ let idx = tx.escaped.len() - 1;
+ let value = &tx.escaped[idx];
*buffer = value.as_ptr(); //unsafe
*buffer_len = value.len() as u32;
return 1;
//temporary escaped header for detection
//must be attached to transaction for memory management (be freed at the right time)
- pub escaped_tmp: Vec<u8>,
+ pub escaped: Vec<Vec<u8>>,
}
impl HTTP2Transaction {
events: std::ptr::null_mut(),
tx_data: AppLayerTxData::new(),
ft: FileTransferTracker::new(),
- escaped_tmp: Vec::new(),
+ escaped: Vec::with_capacity(16),
}
}