0,
);
(c.HttpRangeFreeBlock)(self.file_range);
+ self.file_range = std::ptr::null_mut();
}
}
}
}
pub fn free(&mut self) {
+ // this should be in HTTP2Transaction::free
+ // but we need state's file container cf https://redmine.openinfosecfoundation.org/issues/4444
+ for tx in &mut self.transactions {
+ if !tx.file_range.is_null() {
+ match unsafe { SC } {
+ None => panic!("BUG no suricata_config"),
+ Some(c) => {
+ (c.HTPFileCloseHandleRange)(
+ &mut self.files.files_tc,
+ 0,
+ tx.file_range,
+ std::ptr::null_mut(),
+ 0,
+ );
+ (c.HttpRangeFreeBlock)(tx.file_range);
+ tx.file_range = std::ptr::null_mut();
+ }
+ }
+ }
+ }
self.transactions.clear();
}
let mut found = false;
let mut index = 0;
for i in 0..len {
- let tx = &self.transactions[i];
+ let tx = &mut self.transactions[i];
if tx.tx_id == tx_id + 1 {
found = true;
index = i;
0,
);
(c.HttpRangeFreeBlock)(tx.file_range);
+ tx.file_range = std::ptr::null_mut();
}
}
}