mirror of
https://github.com/OISF/suricata.git
synced 2026-10-11 22:09:53 +00:00
stream/cache: Return sessions to correct pool
Issue: 5563 This commit fixes the release of TCP resources. The sessions were being returned to the segment thread pool instead of the sessions pool.
This commit is contained in:
committed by
Victor Julien
parent
0d0c9ea07b
commit
f8c9390ca3
@@ -157,19 +157,19 @@ void StreamTcpThreadCacheCleanup(void)
|
||||
/* sessions */
|
||||
SCLogDebug("tcp_pool_cache.ssns_cache_idx %u", tcp_pool_cache.ssns_cache_idx);
|
||||
for (uint32_t i = 0; i < tcp_pool_cache.ssns_cache_idx; i++) {
|
||||
PoolThreadReturn(segment_thread_pool, tcp_pool_cache.ssns_cache[i]);
|
||||
PoolThreadReturn(ssn_pool, tcp_pool_cache.ssns_cache[i]);
|
||||
}
|
||||
tcp_pool_cache.ssns_cache_idx = 0;
|
||||
|
||||
SCLogDebug("tcp_pool_cache.ssns_returns_idx %u", tcp_pool_cache.ssns_returns_idx);
|
||||
if (tcp_pool_cache.ssns_returns_idx) {
|
||||
PoolThreadId pool_id = tcp_pool_cache.ssns_returns[0]->pool_id;
|
||||
PoolThreadLock(segment_thread_pool, pool_id);
|
||||
PoolThreadLock(ssn_pool, pool_id);
|
||||
for (uint32_t i = 0; i < tcp_pool_cache.ssns_returns_idx; i++) {
|
||||
TcpSession *ret_ssn = tcp_pool_cache.ssns_returns[i];
|
||||
PoolThreadReturnRaw(segment_thread_pool, pool_id, ret_ssn);
|
||||
PoolThreadReturnRaw(ssn_pool, pool_id, ret_ssn);
|
||||
}
|
||||
PoolThreadUnlock(segment_thread_pool, pool_id);
|
||||
PoolThreadUnlock(ssn_pool, pool_id);
|
||||
tcp_pool_cache.ssns_returns_idx = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user