-/* Copyright (C) 2020 Open Information Security Foundation
+/* Copyright (C) 2020-2022 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
use nom;
use std;
use std::ffi::{CStr, CString};
+use std::collections::VecDeque;
use std::fmt;
use std::io;
use std::mem::transmute;
response_frame_size: u32,
dynamic_headers_ts: HTTP2DynTable,
dynamic_headers_tc: HTTP2DynTable,
- transactions: Vec<HTTP2Transaction>,
+ transactions: VecDeque<HTTP2Transaction>,
progress: HTTP2ConnectionState,
pub files: HTTP2Files,
}
// a variable number of dynamic headers
dynamic_headers_ts: HTTP2DynTable::new(),
dynamic_headers_tc: HTTP2DynTable::new(),
- transactions: Vec::new(),
+ transactions: VecDeque::new(),
progress: HTTP2ConnectionState::Http2StateInit,
files: HTTP2Files::new(),
}
self.tx_id += 1;
tx.tx_id = self.tx_id;
tx.state = HTTP2TransactionState::HTTP2StateGlobal;
- self.transactions.push(tx);
- return self.transactions.last_mut().unwrap();
+ self.transactions.push_back(tx);
+ return self.transactions.back_mut().unwrap();
}
pub fn find_or_create_tx(
tx.tx_id = self.tx_id;
tx.stream_id = sid;
tx.state = HTTP2TransactionState::HTTP2StateOpen;
- self.transactions.push(tx);
- return self.transactions.last_mut().unwrap();
+ self.transactions.push_back(tx);
+ return self.transactions.back_mut().unwrap();
}
}