Skip to content

Commit

Permalink
template: use response_gap in rust parser
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Feb 5, 2021
1 parent 62e665c commit 124fd94
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rust/src/applayertemplate/template.rs
Expand Up @@ -177,6 +177,17 @@ impl TemplateState {
return AppLayerResult::ok();
}

if self.response_gap {
if probe(input).is_err() {
// The parser now needs to decide what to do as we are not in sync.
// For this template, we'll just try again next time.
return AppLayerResult::ok();
}

// It looks like we're in sync with a message header, clear gap
// state and keep parsing.
self.response_gap = false;
}
let mut start = input;
while start.len() > 0 {
match parser::parse_message(start) {
Expand Down

0 comments on commit 124fd94

Please sign in to comment.