From 49dcb0ca846cfa2661a25aa5f626904b2900e6da Mon Sep 17 00:00:00 2001 From: Anoop Saldanha Date: Sun, 1 Sep 2013 15:44:52 +0530 Subject: [PATCH] fix for #925. Log sensible error message when the user doesn't supply a value for stream.prealloc-sessions or when the values supplied in invalid and the engine resorts to using a default. --- src/stream-tcp.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index a4b5cb14bb..b9442bf31c 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -347,10 +347,16 @@ void StreamTcpInitConfig(char quiet) if ((ConfGetInt("stream.prealloc-sessions", &value)) == 1) { stream_config.prealloc_sessions = (uint32_t)value; } else { - if (RunmodeIsUnittests()) + if (RunmodeIsUnittests()) { stream_config.prealloc_sessions = 128; - else + } else { stream_config.prealloc_sessions = STREAMTCP_DEFAULT_PREALLOC; + if (ConfGetNode("stream.prealloc-sessions") != NULL) { + WarnInvalidConfEntry("stream.prealloc_sessions", + "%"PRIu32, + stream_config.prealloc_sessions); + } + } } if (!quiet) { SCLogInfo("stream \"prealloc-sessions\": %"PRIu32" (per thread)",