mqtt: fix transaction completion

Ticket: 4862

A transaction to client is always considered
complete in the direction to server and vice versa.
Otherwise, transactions are never complete for
AppLayerParserTransactionsCleanup
pull/6680/head
Philippe Antoine 4 years ago committed by Victor Julien
parent ecce116117
commit 1b10848d84

@ -627,13 +627,14 @@ pub unsafe extern "C" fn rs_mqtt_tx_get_alstate_progress(
direction: u8,
) -> std::os::raw::c_int {
let tx = cast_pointer!(tx, MQTTTransaction);
if tx.complete {
if direction == Direction::ToServer.into() {
if tx.toserver {
match direction.into() {
Direction::ToServer => {
if tx.complete || tx.toclient {
return 1;
}
} else if direction == Direction::ToClient.into() {
if tx.toclient {
}
Direction::ToClient => {
if tx.complete || tx.toserver {
return 1;
}
}

Loading…
Cancel
Save