From: Victor Julien Date: Sat, 21 Jan 2023 12:39:10 +0000 (+0100) Subject: streaming: add sbcfg to StreamingBufferClear X-Git-Tag: suricata-7.0.0-rc1~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ff882cd73f9eda2296435e6420fa43d5f05b19d9;p=thirdparty%2Fsuricata.git streaming: add sbcfg to StreamingBufferClear --- diff --git a/src/stream-tcp-list.c b/src/stream-tcp-list.c index 50d51eaf74..60615ec8c9 100644 --- a/src/stream-tcp-list.c +++ b/src/stream-tcp-list.c @@ -914,7 +914,7 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags) SCLogDebug("ssn %p / stream %p: reassembly depth reached, " "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream); StreamTcpReturnStreamSegments(stream); - StreamingBufferClear(&stream->sb); + StreamingBufferClear(&stream->sb, &stream_config.sbcnf); return; } else if ((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) && @@ -923,7 +923,7 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags) "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream); stream->flags |= STREAMTCP_STREAM_FLAG_NOREASSEMBLY; StreamTcpReturnStreamSegments(stream); - StreamingBufferClear(&stream->sb); + StreamingBufferClear(&stream->sb, &stream_config.sbcnf); return; } diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 669f0c3096..c4356a3bf2 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -200,7 +200,7 @@ void StreamTcpStreamCleanup(TcpStream *stream) if (stream != NULL) { StreamTcpSackFreeList(stream); StreamTcpReturnStreamSegments(stream); - StreamingBufferClear(&stream->sb); + StreamingBufferClear(&stream->sb, &stream_config.sbcnf); } } diff --git a/src/util-streaming-buffer.c b/src/util-streaming-buffer.c index 8700c6613f..c54737ded7 100644 --- a/src/util-streaming-buffer.c +++ b/src/util-streaming-buffer.c @@ -154,7 +154,7 @@ StreamingBuffer *StreamingBufferInit(const StreamingBufferConfig *cfg) return NULL; } -void StreamingBufferClear(StreamingBuffer *sb) +void StreamingBufferClear(StreamingBuffer *sb, const StreamingBufferConfig *cfg) { if (sb != NULL) { SCLogDebug("sb->region.buf_size %u max %u", sb->region.buf_size, sb->buf_size_max); @@ -180,7 +180,7 @@ void StreamingBufferClear(StreamingBuffer *sb) void StreamingBufferFree(StreamingBuffer *sb, const StreamingBufferConfig *cfg) { if (sb != NULL) { - StreamingBufferClear(sb); + StreamingBufferClear(sb, cfg); FREE(sb->cfg, sb, sizeof(StreamingBuffer)); } } diff --git a/src/util-streaming-buffer.h b/src/util-streaming-buffer.h index bc5182559b..263a45de15 100644 --- a/src/util-streaming-buffer.h +++ b/src/util-streaming-buffer.h @@ -157,7 +157,7 @@ typedef struct StreamingBufferSegment_ { } __attribute__((__packed__)) StreamingBufferSegment; StreamingBuffer *StreamingBufferInit(const StreamingBufferConfig *cfg); -void StreamingBufferClear(StreamingBuffer *sb); +void StreamingBufferClear(StreamingBuffer *sb, const StreamingBufferConfig *cfg); void StreamingBufferFree(StreamingBuffer *sb, const StreamingBufferConfig *cfg); void StreamingBufferSlideToOffset(