Skip to content

Commit

Permalink
mqtt: Improve handling of multiple PDU parsing
Browse files Browse the repository at this point in the history
Issue: 6592
  • Loading branch information
jlucovsky committed Jan 30, 2024
1 parent c3b3c11 commit 1e51d70
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions rust/src/mqtt/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,15 @@ impl MQTTState {
}

while !current.is_empty() {
SCLogDebug!("request: handling {}", current.len());
SCLogDebug!("request: handling {}; rem: {}", current.len(), input.len() - current.len());
match parse_message(current, self.protocol_version, self.max_msg_len) {
Ok((rem, msg)) => {
SCLogDebug!("request: handling {}; rem: {}", current.len(), input.len() - current.len());
let _pdu = Frame::new(
flow,
&stream_slice,
input,
current.len() as i64,
current,
(current.len() - rem.len()) as i64,
MQTTFrameType::Pdu as u8,
);
SCLogDebug!("request msg {:?}", msg);
Expand Down Expand Up @@ -550,11 +551,12 @@ impl MQTTState {
SCLogDebug!("response: handling {}", current.len());
match parse_message(current, self.protocol_version, self.max_msg_len) {
Ok((rem, msg)) => {
SCLogDebug!("response: handling {}; rem: {}", current.len(), input.len() - current.len());
let _pdu = Frame::new(
flow,
&stream_slice,
input,
input.len() as i64,
current,
(current.len() - rem.len()) as i64,
MQTTFrameType::Pdu as u8,
);

Expand Down

0 comments on commit 1e51d70

Please sign in to comment.