http: simplify tx removal interface

pull/13235/head
Philippe Antoine 3 months ago committed by Victor Julien
parent ba186f5d25
commit 756f28d086

@ -8,9 +8,9 @@ use std::convert::{TryFrom, TryInto};
/// # Safety
/// When calling this method, you have to ensure that tx is either properly initialized or NULL
#[no_mangle]
pub unsafe extern "C" fn htp_tx_destroy(connp: *mut ConnectionParser, tx: *const Transaction) {
if let (Some(connp), Some(tx)) = (connp.as_mut(), tx.as_ref()) {
connp.remove_tx(tx.index)
pub unsafe extern "C" fn htp_tx_destroy(connp: *mut ConnectionParser, index: usize) {
if let Some(connp) = connp.as_mut() {
connp.remove_tx(index)
}
}

@ -536,11 +536,7 @@ static void HTPStateTransactionFree(void *state, uint64_t id)
HtpState *s = (HtpState *)state;
SCLogDebug("state %p, id %"PRIu64, s, id);
htp_tx_t *tx = HTPStateGetTx(s, id);
if (tx != NULL) {
htp_tx_destroy(s->connp, tx);
}
htp_tx_destroy(s->connp, id);
}
/**

Loading…
Cancel
Save