stream: use max-region setting from suricata.yaml

1. Add key (commented) to suricata.yaml
2. Give the configured/default key preference, save a check
pull/12862/head
Shivani Bhardwaj 4 months ago committed by Victor Julien
parent 22d05c289c
commit 7f98683d45

@ -213,7 +213,7 @@ static StreamingBufferRegion *FindRightEdge(const StreamingBufferConfig *cfg,
static inline StreamingBufferRegion *InitBufferRegion(
StreamingBuffer *sb, const StreamingBufferConfig *cfg, const uint32_t min_size)
{
if (sb->regions == USHRT_MAX || (cfg->max_regions != 0 && sb->regions >= cfg->max_regions)) {
if ((cfg->max_regions != 0 && sb->regions >= cfg->max_regions) || (sb->regions == UINT16_MAX)) {
SCLogDebug("max regions reached");
sc_errno = SC_ELIMIT;
return NULL;

@ -1643,6 +1643,9 @@ flow-timeouts:
# # is used or when stream-event:reassembly_overlap_different_data;
# # is used in a rule.
#
# max-regions: 8 # maximum number of concurrent regions per streaming buffer
# # defaults to 8, if no configuration was provided. 0 means no limit.
stream:
memcap: 64 MiB
#memcap-policy: ignore

Loading…
Cancel
Save