streaming: add sbcfg to StreamingBufferClear

pull/8426/head
Victor Julien 3 years ago
parent 6e5f35e0a0
commit ff882cd73f

@ -914,7 +914,7 @@ void StreamTcpPruneSession(Flow *f, uint8_t flags)
SCLogDebug("ssn %p / stream %p: reassembly depth reached, " SCLogDebug("ssn %p / stream %p: reassembly depth reached, "
"STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream); "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream);
StreamTcpReturnStreamSegments(stream); StreamTcpReturnStreamSegments(stream);
StreamingBufferClear(&stream->sb); StreamingBufferClear(&stream->sb, &stream_config.sbcnf);
return; return;
} else if ((ssn->flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) && } 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); "STREAMTCP_STREAM_FLAG_NOREASSEMBLY set", ssn, stream);
stream->flags |= STREAMTCP_STREAM_FLAG_NOREASSEMBLY; stream->flags |= STREAMTCP_STREAM_FLAG_NOREASSEMBLY;
StreamTcpReturnStreamSegments(stream); StreamTcpReturnStreamSegments(stream);
StreamingBufferClear(&stream->sb); StreamingBufferClear(&stream->sb, &stream_config.sbcnf);
return; return;
} }

@ -200,7 +200,7 @@ void StreamTcpStreamCleanup(TcpStream *stream)
if (stream != NULL) { if (stream != NULL) {
StreamTcpSackFreeList(stream); StreamTcpSackFreeList(stream);
StreamTcpReturnStreamSegments(stream); StreamTcpReturnStreamSegments(stream);
StreamingBufferClear(&stream->sb); StreamingBufferClear(&stream->sb, &stream_config.sbcnf);
} }
} }

@ -154,7 +154,7 @@ StreamingBuffer *StreamingBufferInit(const StreamingBufferConfig *cfg)
return NULL; return NULL;
} }
void StreamingBufferClear(StreamingBuffer *sb) void StreamingBufferClear(StreamingBuffer *sb, const StreamingBufferConfig *cfg)
{ {
if (sb != NULL) { if (sb != NULL) {
SCLogDebug("sb->region.buf_size %u max %u", sb->region.buf_size, sb->buf_size_max); 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) void StreamingBufferFree(StreamingBuffer *sb, const StreamingBufferConfig *cfg)
{ {
if (sb != NULL) { if (sb != NULL) {
StreamingBufferClear(sb); StreamingBufferClear(sb, cfg);
FREE(sb->cfg, sb, sizeof(StreamingBuffer)); FREE(sb->cfg, sb, sizeof(StreamingBuffer));
} }
} }

@ -157,7 +157,7 @@ typedef struct StreamingBufferSegment_ {
} __attribute__((__packed__)) StreamingBufferSegment; } __attribute__((__packed__)) StreamingBufferSegment;
StreamingBuffer *StreamingBufferInit(const StreamingBufferConfig *cfg); StreamingBuffer *StreamingBufferInit(const StreamingBufferConfig *cfg);
void StreamingBufferClear(StreamingBuffer *sb); void StreamingBufferClear(StreamingBuffer *sb, const StreamingBufferConfig *cfg);
void StreamingBufferFree(StreamingBuffer *sb, const StreamingBufferConfig *cfg); void StreamingBufferFree(StreamingBuffer *sb, const StreamingBufferConfig *cfg);
void StreamingBufferSlideToOffset( void StreamingBufferSlideToOffset(

Loading…
Cancel
Save