]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: simplify segment and ssn pool inits
authorVictor Julien <victor@inliniac.net>
Tue, 28 May 2019 13:16:50 +0000 (15:16 +0200)
committerVictor Julien <victor@inliniac.net>
Wed, 29 May 2019 13:34:36 +0000 (15:34 +0200)
src/stream-tcp-reassemble.c
src/stream-tcp.c

index d63251013345808f20fe2979c2695576688c4449..39f8a0310bb8daa5598277328de917f765e03b7c 100644 (file)
@@ -453,13 +453,7 @@ TcpReassemblyThreadCtx *StreamTcpReassembleInitThreadCtx(ThreadVars *tv)
                 ra_ctx->segment_thread_pool_id);
     } else {
         /* grow segment_thread_pool until we have a element for our thread id */
-        ra_ctx->segment_thread_pool_id = PoolThreadGrow(segment_thread_pool,
-                0, /* unlimited */
-                stream_config.prealloc_segments,
-                sizeof(TcpSegment),
-                TcpSegmentPoolAlloc,
-                TcpSegmentPoolInit, NULL,
-                TcpSegmentPoolCleanup, NULL);
+        ra_ctx->segment_thread_pool_id = PoolThreadExpand(segment_thread_pool);
         SCLogDebug("pool size %d, thread segment_thread_pool_id %d",
                 PoolThreadSize(segment_thread_pool),
                 ra_ctx->segment_thread_pool_id);
index 119d278104361ef181648c4df80ef1f8229359d8..3c10dc7d0342045f4891969b8d47629fa7b3757e 100644 (file)
@@ -5191,13 +5191,7 @@ TmEcode StreamTcpThreadInit(ThreadVars *tv, void *initdata, void **data)
         SCLogDebug("pool size %d, thread ssn_pool_id %d", PoolThreadSize(ssn_pool), stt->ssn_pool_id);
     } else {
         /* grow ssn_pool until we have a element for our thread id */
-        stt->ssn_pool_id = PoolThreadGrow(ssn_pool,
-                0, /* unlimited */
-                stream_config.prealloc_sessions,
-                sizeof(TcpSession),
-                StreamTcpSessionPoolAlloc,
-                StreamTcpSessionPoolInit, NULL,
-                StreamTcpSessionPoolCleanup, NULL);
+        stt->ssn_pool_id = PoolThreadExpand(ssn_pool);
         SCLogDebug("pool size %d, thread ssn_pool_id %d", PoolThreadSize(ssn_pool), stt->ssn_pool_id);
     }
     SCMutexUnlock(&ssn_pool_mutex);