|
|
|
@ -103,12 +103,7 @@ impl TemplateState {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn get_tx(&mut self, tx_id: u64) -> Option<&TemplateTransaction> {
|
|
|
|
pub fn get_tx(&mut self, tx_id: u64) -> Option<&TemplateTransaction> {
|
|
|
|
for tx in &mut self.transactions {
|
|
|
|
self.transactions.iter().find(|tx| tx.tx_id == tx_id + 1)
|
|
|
|
if tx.tx_id == tx_id + 1 {
|
|
|
|
|
|
|
|
return Some(tx);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return None;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn new_tx(&mut self) -> TemplateTransaction {
|
|
|
|
fn new_tx(&mut self) -> TemplateTransaction {
|
|
|
|
@ -119,12 +114,7 @@ impl TemplateState {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn find_request(&mut self) -> Option<&mut TemplateTransaction> {
|
|
|
|
fn find_request(&mut self) -> Option<&mut TemplateTransaction> {
|
|
|
|
for tx in &mut self.transactions {
|
|
|
|
self.transactions.iter_mut().find(|tx| tx.response.is_none())
|
|
|
|
if tx.response.is_none() {
|
|
|
|
|
|
|
|
return Some(tx);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
None
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
fn parse_request(&mut self, input: &[u8]) -> AppLayerResult {
|
|
|
|
fn parse_request(&mut self, input: &[u8]) -> AppLayerResult {
|
|
|
|
|